A man jailed in Los Angeles County for a month because he was mistaken for someone with the same name and birth date lost a legal effort Wednesday to hold law enforcement agencies responsible for the mix-up.

A three-judge panel of the U.S. 9th Circuit Court of Appeals rejected claims by Santiago Rivera that the Los Angeles and San Bernardino County sheriff’s departments violated his constitutional rights when they arrested and held him based on a warrant for another man.