When Willie Nash was booked into a Mississippi corrections facility, officers failed to confiscate his phone. For that, he was sentenced to 12 years behind bars. The state’s Supreme Court acknowledges that proper booking procedure was probably not followed and that Nash did not seem to know his phone was illegal, but they nonetheless ruled Thursday that the sentence is fair.

After Nash was booked into the Newton County Jail on a misdemeanor charge, he asked a jailer to charge his phone, seemingly unaware that he was not supposed to have the item. Mississippi Code Section 47-5-193 considers the possession behind bars of “any weapon, deadly weapon, unauthorized electronic device, contraband item, or cell phone” a felony; the offense carries a prison sentence of three to 15 years.

The jailer took the phone to a sheriff’s deputy. Nash initially denied ownership, but officials confirmed that it was his using the passcode he had previously provided the jailer. In one of the text exchanges discovered, a contact inquired about Nash’s location, to which he responded, “in jail.”

A jury then found Nash guilty of possessing of a cell phone in a correctional facility. At sentencing, the judge told Nash to “consider yourself fortunate.” Had the court used Nash’s previous burglary convictions to classify him as a habitual offender, he would have received the full 15 years in prison, not 12.

The Court shot down the “differing degrees of transgression” argument on the grounds that the statute warns against violating “any provision.” And since the sentence fell within the “statutory range”—that is, because it does not exceed 15 years—the Court said it could not be appealed.

“While obviously harsh, Nash’s twelve-year sentence for possessing a cell phone in a correctional facility is not grossly disproportionate,” the Court concluded. The judge, the decision noted, had expressed his reasoning for the sentence, citing Nash’s prior convictions and acknowledging that he could have given Nash the full 15 years.

In a concurring opinion, Associate Justice Leslie D. King wrote that while the Court upheld case law in its ruling, the case “seems to demonstrate a failure of our criminal justice system on multiple levels.”