It’s not illegal to masturbate in public in Italy as long as it’s not performed in front of minors, according to the Italian Supreme Court.

The high court referred to as La Corte di Cassazione recently overturned a jail sentence of a 69-year-old man, only identified as “PL,” who faced charges for masturbating in front of students at the University of Cantania on Sicily’s east coast in May 2015, CNN reported Thursday. Upon the man’s arrest, he was sentenced to three months in prison and ordered to pay a fine of €3,200 (around $3,600).

However, after appealing to the Supreme Court, the judges ruled that public masturbation away from the presence of minors is no longer considered criminal conduct because of a change that had been made in the law last year, which decriminalized the act. Documents filed with the Supreme Court noted that the updated criminal code only calls for imprisonment up to four-and-a-half years if witnessed by a minor. Although “PL” is avoiding jail time, he will still be forced to pay a fine.

Since the ruling, prosecutors have requested the case to be returned back to local courts in Catania to determine the amount of the administrative fine – between €5,000 ($5,651) and €30,000 ($33,912) – will be.

Public masturbation is illegal in many countries around the world and instances in many place. In Indonesia, the act can lead to up to 32 months of imprisonment while in the United Kingdom criminals can spend up to 14 days in prison if caught. In Saudi Arabia, public masturbation convictions come with three-year prison sentences and up to 300 lashes, The Guardian reported.

In the United States, public masturbation and indecent exposure laws vary from state to state. n Alabama, anything related to masturbation, including artificial “devices designed primarily for the stimulation of human genital organs” is prohibited, whereas in North Carolina public masturbation is considered a Class 3 Misdemeanor but can be easily avoided with the help of a clever lawyer. In Texas, people caught performing the act can spend up to two years in prison.