A high school in Northern California wasn’t doing anything wrong when it asked students to turn their T-shirts with American flags inside out on Cinco de Mayo, the Mexican heritage celebration, the 9th U.S. Circuit Court of Appeals ruled Thursday.

The court said that the school officials’ concern that star spangled T-shirts might provoke racial violence outweighed the student’s rights to freedom of expression, and that it was correct of the officials to prioritize campus safety.

The school, Live Oak High School, has previously had problems between white and Latino students on the holiday celebrating Mexican troops’ defeat of the French army in 1862.

One of the lawyers representing the students said he will appeal the case all the way to the Supreme Court if necessary.