ALBANY, N.Y. (AP) — It’s official: New Yorkers will have to wait until August to vote in the primary elections for U.S. representatives, rather than June, after a federal judge gave his stamp of approval to the delay Tuesday.

Pushing back the primary to Aug. 23 would avoid a “chaotic situation” for voters, said U.S. District Judge Gary Sharpe of Albany, and give the state’s congressional redistricting process enough time to play out.

Primaries for governor and the state Assembly are still scheduled for June.

The new Democrat-drawn congressional maps that were supposed to be used in this year’s elections were deemed unconstitutional by New York’s high court, which found the maps violated an anti-gerrymandering constitutional amendment. That dealt a big blow to Democrats’ hopes of crafting an electoral map that would be heavily favorable to their party.

A state judge and an independent expert are now drawing up replacement congressional and state Senate maps. Moving the state Senate primary doesn’t need federal approval.

A group of voters represented by a Democratic lawyer fought the state judge’s decision to delay the primary, arguing it violated a decade-old federal court order that set the primaries in late June. The voters unsuccessfully pushed for New York to hold June primaries using the thrown-out maps.

But Sharpe said Tuesday that the courts have the power to modify the federal court order, and ordered New York to ensure it sends out absentee ballots to military and overseas voters in time for the congressional primaries and the November general elections.