A Louisiana man pleaded guilty Monday in federal court for attempting to get President Donald Trump’s tax returns by using his Social Security number.

Jordan Hamlett, 32, was indicted on a felony charge of false representation of a Social Security number in November of last year. Hamlett, a private investigator, was attempting to gain the president’s taxes through a security flaw in the U.S. Department of Education’s Free Application for Federal Student Aid (FAFSA) website. 

Hamlet faces up to five years in prison and a $250,000 fine.

Hamlett attempted to get the information in September last year, just before the election. Special Agent Samuel Johnson of the U.S. Treasury Inspector General for Tax Administration said that investigators worried that if Hamlett was successful, the information could have swayed the presidential election.

“There [were] thoughts this could be something that would affect the election if the information had been received,” Johnson testified in court. “At the time it was believed that with the information that was used to attempt to obtain the tax returns, there was a possibility that somebody could figure out a way to get the tax returns out of the database and release them, sell them, whatever they were going to do.”

Hamlett’s lawyers said that he was a “white hat” hacker and was merely trying to expose the security flaw to the government. Hamlett’s lawyers argued that he tried to get Trump’s taxes through FAFSA “out of sheer curiosity,” according to the Associated Press Monday.

Hamlett had called the Internal Revenue Service in an attempt to warn them about the vulnerability, Hamlett’s lawyer Michael Fiser told the court.

Fiser argued that looking for security vulnerabilities in sites was a hobby of Hamlett’s. He allegedly discovered an issue in the Livingston Parish, Louisiana Sheriff’s Office website and alerted them to it in the past.

“Hamlett tipped the sheriff's office to the flaw and was met with thanks and appreciation, not an arrest,” wrote Fiser in a court filing.

Trump's decision to not release his tax returns ignited controversy during the 2016 campaign. He was the first presidential nominee to not release his taxes since Gerald Ford in 1976.