The First Amendment gives Americans the right to freedom of speech and expression, but it turns out that it doesn’t give them the right to film pornography without condoms.

A federal appeals court upheld a Los Angeles County law on Monday that forces porn actors to use condoms during filming within the county. The measure was approved by voters in 2012. Since then, it had been blamed for a reduction of porn productions inside LA County.

While the porn industry opposed the measure, with Vivid Entertainment ultimately filing the lawsuit, a three-judge panel ruled that it protects the health of not only the cast and crew, but the public at large as well.

“The requirement that actors in adult films wear condoms while engaging in sexual intercourse might have ‘some minimal effect’ on a film’s erotic message, but that effect is certainly no greater than the effect of pasties and G-strings on the erotic message of nude dancing,” the ruling reads, notes The Los Angeles Daily News.

The AIDS Healthcare Foundation was named as the defendant in the lawsuit. Executive director Michael Weinstein defended the law, saying that it will help stop sexually transmitted diseases.

“Today’s ruling by the 9th Circuit is a total vindication of AHF’s position,” Weinstein said. “We’ve been having this discussion for years. Now it’s a question of enforcement. I think one of the most important things the court did today is they said it’s clearly a public health interest.”

According to Fox News, Vivid filed the lawsuit in January 2013 and has already lost in federal court. It’s not known if the company plans on appealing to the Supreme Court. However, Weinstein said that if Vivid plans to do so, AHF will be up for the challenge.