A Pennsylvania inmate has spent more than a year in solitary confinement because he refuses to cut his dreadlocks.

Eric S. McGill, 27, filed a handwritten lawsuit in October naming three senior jailers at the Lebanon County Correctional Facility. Last week, a group of lawyers amended the federal complaint to note that McGill’s mental health is suffering from the solitary confinement, leaving him to have anxiety attacks several times a week, reported The Associated Press.

“By keeping Mr. McGill in solitary confinement because he refuses to cut off his dreadlocks, (the) defendants have inhibited his right to free exercise of religion for no legitimate penological purpose,” McGill’s lawyers with the Pennsylvania Institutional Law Project told the court, seeking an order that would mandate McGill be placed in general population, plus be awarded damages, according to The Associated Press.

READ MORE: Dylann Roof staged hunger strike to protest ‘harsh’ treatment inside federal prison

McGill follows Rastafarianism and believes his spirit lives in his dreadlocks and that he would lose strength in the afterlife if he cuts them, according to his lawyers.

Peggy Morcom, Lebanon County’s lawyer for labor and employment matters, didn’t address the amended complaint, but has previously argued that Pennsylvania state law allows county jails to set inmate hairstyles requiring that they “comply with sanitation and security policies.”

Morcom has warned that inmates can hide contraband in their hair, and said the county’s position is to ensure “security and cleanliness.” She also cited a 2006 state Commonwealth Court decision that ruled that state prisons “held that the legitimate interests of the correctional facility outweighed any rights the prisoner had” to choose his or her hairstyle, The Associated Press reported.

READ MORE: Five Mississippi teenagers face capital murder charges for allegedly killing a 16-year-old girl

However, since that state decision, Pennsylvania has updated its inmate grooming policy. As of July 2016, state prisoners can wear their hair any length they’d like, but jailers can search their hair and can check dreadlocks with a handheld metal detector, according to the news service.

The amended state rules don’t apply to county jails.

McGill faces trial next month on several counts of attempted homicide, aggravated assault and other charges related to a January 2019 shooting where four people were injured.