Rikers Island jail with the New York skyline in the background. (Seth Wenig/AP)

New York’s Rikers Island has a long and storied history. Mother Jones ranked it as one of America’s “worst prisons.” Sitting on an island that was once used to raise pigs for slaughter and as a landfill, the correctional facility has a long history of gang violence and widespread corruption among its guards.

It was here that 41-year-old Aitabdel Salem, a native of Algeria, spent five months for no good reason. His bail was set at a mere $2 — the price of a slice of New York pizza — but allegedly no one actually told him. Salem, thinking his bail was set at $25,000, languished on Rikers Island from November 2014 to April 2015 although he could have walked out at any time.

Salem was arrested Nov. 21, 2014, accused of attacking the New York police officer who was arresting him in the theft of a coat from a Zara location in the Flatiron District, the New York Daily News reported. His bail was set at $25,000, more than Salem could afford.

Prosecutors weren’t able to get an indictment for the alleged police assault, though, and Salem’s release from that charge was ordered just a week later on Nov. 28.

He still faced charges for two minor offenses from allegedly tampering with a subway card machine in 2014, according to Mashable, so he was required to post bail before leaving jail. Since the charges were so small, a judge dropped his bail to a dollar for each charge, totaling $2.

According to Salem, though, no one told him. Salem’s new attorneys, Glenn Hardy and Theodore Goldbergh, are placing the blame on his previous attorney.

Salem “was shocked and dismayed and frustrated that his case was unconscionably mishandled and there was no communication by his attorney telling him his bail was $2 which he could have made at any moment,” Glenn Hardy said at a recent court hearing, according to WPIX.

The previous attorney has not responded.

Salem was released in April 2015, five months after being arrested, but was arrested again for failing to appear at an arraignment for the original assault charge a few weeks later, on May 13, according to the Daily News. His lawyers claim the letter informing Salem of his court date was lost in the mail and had been stamped “return to sender” by the post office.

“You can’t do what you don’t know and if you’re a defendant in a criminal case you certainly have a right to rely upon the system [to know] what your next court date is,” Goldbergh said.

According to court records, his bail is now set at $30,000, the Centre Daily Times reported.

Last June, 22-year-old Kalief Browder committed suicide after being held in Rikers for three years, from 2010 to 2013, without a trial on charges related to stealing a backpack, Agence France-Presse reported.