A U.S. appeals court rebuked a new Indiana law that sought to aggressively cancel voter registrations, agreeing with a lower court ruling that blocked the law last year.

The Indiana law, passed in 2017, allowed election officials to cancel a voter’s registration without first getting confirmation from the voter. The officials could instead use Interstate Crosscheck, a database of voters from two dozen states, to see if the person was registered in another state. Even though there is evidence the Crosscheck database is unreliable, the Indiana election officials could cancel the voter’s registration if they found a registration matched that of a voter in another state.

A Federal law called the National Voter Registration Act (NVRA) sets out specific conditions under which a state may remove voters from its rolls. Those conditions include if someone requests to be removed. The law also requires states to implement a “non-discriminatory” program that makes a “reasonable effort” to remove people from the rolls who have died or moved. Last year, a federal judge blocked the Indiana measure, saying it appeared to run afoul of that federal law. On Tuesday, a three-judge panel for the U.S. Court of Appeals for the 7th Circuit agreed with that finding.

Diane Wood, the circuit’s chief judge, authored the opinion and was unsparing in her criticism of the Indiana law. She dismissed the argument from Indiana’s lawyers that the procedure was permissible because the matching voter registration in another state amounted to a request to be removed from the rolls. Wood noted that someone might move from Indiana, register in another state, but then have personal circumstances change and move back to Indiana before election day. She noted there was a distinction between voting twice ― which is illegal ― and being registered twice, which is not.

“Especially in states that have an early registration deadline, it may be perfectly rational for a voter to register in a new location before getting around to canceling the old Indiana registration, selling an Indiana house, or severing other formal connections with Indiana,” she said. “The only way to know whether voters want to cancel their registration is to ask them.”