PORT WASHINGTON, N.Y. (CBSNewYork) — An immigrant from Jamaica said he was stuck in jail for nine months due to a clerical error.

Now he’s out, angry and suing.

His time behind bars both difficult and depressing, Iykeland Ricketts said being separated from his children and wife took a toll.

“It was very traumatic — not only for me, for my kids and my wife. We almost got put out of our house, all my stuff, me and my kids. What would we do if I was locked up even longer?” Ricketts told CBS 2’s Tony Aiello on Wednesday.

He spent months in jail. His lawyer, Nicholas Warywoda, said it was all a mistake.

“A clerk or someone in the court system just didn’t do their job and didn’t pay attention. It’s as simple as a stroke on a computer can cause someone to lose their freedom for nine months!” Warywoda said.

It began in the Bronx in 2010, when Ricketts, then 19 years old, was busted for subway fare evasion. When police searched Rickett’s pockets, they found a small amount of marijuana.

He went to court and everyone agreed to reduce the charges to disorderly conduct — a violation that carries no jail time. But it appears a clerk mistakenly entered the conviction as a misdemeanor drug charge. During a routine immigration check last year, the wrong conviction showed up and Ricketts was sent to jail, his attorney said.