A federal appeals court ruled on Friday that a transgender man’s case to legally change his name.

The man, who is only called “John Doe” in court papers to protect his privacy, was born in Mexico and has been living in Indiana since 1990. In 2015, he was granted asylum because he feared what would happen as a transgender person in Mexico.

He began transitioning in 2013 and wanted to legally change his name, but a 2010 law in Indiana requires proof of citizenship for a name change.

With the help of the Transgender Law Center and the Mexican American Legal Defense and Educational Fund, Doe is suing the state. He alleges that the Indiana law violates his free speech, due process, and equal protection rights.

“I want to use a name that is in line with my true identity,” he said. “Without a legal name change, I am forced to use an I.D. that is inconsistent with who I am and puts me in danger of harassment, violence, and being outed as transgender whenever I present it. I am simply asking for equal treatment under the law.”

Last year, an Indiana court dismissed his suit for lack of standing. On Friday, the 7th Circuit Court of Appeals dismissed his suit, saying that he named the wrong defendants.

“Everyone should be able to live as their authentic selves no matter their gender identity or immigration status, and today’s decision will not deter Mr. Doe and thousands of others fighting to be recognized for who they are,” said Shawn Thomas Meerkamper of the Transgender Law Center.

In a few years, Doe will be allowed to apply for U.S. citizenship and the name change could be easier. Still, he is in need of documents that match his gender identity right now, and there’s no reason that the country he resides in can’t provide him with the correct paperwork.