WICHITA, Kan. (AP) – A federal judge has ruled that provisions in a Kansas law that ban the secret filming at slaughterhouses and other livestock facilities unconstitutionally criminalize free speech.

U.S. District Judge Kathryn Vratil mostly sided on Wednesday with a coalition of animal rights and consumer protection groups which had challenged the state’s “Ag-Gag” law, which was enacted in 1990. The law makes it a crime for anyone to take a picture or video at animal facilities without the owner’s consent or to enter them under false pretenses.

The judge says the Kansas law only targets negative views about animal facilities.