MADISON, Wis. (AP) — An appeals court says the state can involuntarily medicate prisoners even if they don’t pose a threat.

According to court documents, a defendant identified as C.S. was convicted of mayhem in 2005 and sentenced to 20 years in prison. A jury in 2015 found C.S. was mentally ill and a judge ordered involuntarily medication.

C.S. argued involuntary medication statutes are unconstitutional because they don’t require a finding that the prisoner is dangerous.

The 2nd District Court of Appeals ruled Wednesday that statutes protect prisoners in other ways, including informing prisoners about treatment needs and determining whether the prisoner is competent to make treatment decisions. The court added that the state has an interest in caring for mentally ill inmates.

C.S.’ attorney didn’t immediately respond to an email.