A federal judge in Florida on Monday dismissed President Donald Trump’s $10 billion lawsuit against media baron Rupert Murdoch and The Wall Street Journal, which claimed the newspaper defamed Trump with a story saying the president had sent a “bawdy” 50th birthday letter to notorious sex offender Jeffrey Epstein.

But Trump will be given the chance to file a new amended lawsuit in the case, Judge Darrin Gayles said in his ruling in U.S. District Court in Miami.

Gayles said he had to dismiss the civil complaint because Trump, who has denied sending the letter to his then-friend Epstein in 2003, had “not plausibly alleged that the Defendants published the Article with actual malice.”

Plaintiffs who are public figures like Trump must show that a defendant had actual malice when they made allegedly defamatory statements, according to legal precedent.

But Gayles, in his decision allowing Trump to amend his lawsuit, cited another precedent that says a plaintiff “should have the opportunity to amend his complaint” if a lawsuit was tossed out for failing to plead facts in that suit “giving rise to an inference of actual malice.”