The Supreme Court’s ruling letting more than a dozen states keep their post-election grace periods for mail ballots is a defeat for President Donald Trump and Republicans ahead of the midterms, but the GOP can still capture significant victories in major election-related cases coming further down the pipeline.

On Monday, two Republican-appointees joined the three liberal justices in rejecting GOP claims that federal law did not allow states to count postmarked mail ballots that arrive at election offices after Election Day. The ruling upheld Mississippi’s five-day mail ballot grace period — after the 5th US Circuit Court of Appeals had struck it down. It comes after Trump last year tried to unilaterally punish states for counting mail ballots arrived after Election Day.

But in an under-the-radar maneuver, the Supreme Court took up a separate case that could help Trump and Republicans tighten voter rules in the name of preventing noncitizen voting. Next term, the justices will consider reviving parts of an Arizona law requiring proof of citizenship for voting. The case — RNC v. Mi Familia Vota — could also give states the green light to conduct mass voter purges of suspected noncitizens in the days and the weeks before an election.