The Supreme Court ruled unanimously Monday that states may require presidential electors to support the winner of the popular vote and punish or replace those who don’t, settling a disputed issue in advance of this fall’s election.

Justice Elena Kagan wrote for the court, and attempted to settle the disputed “faithless elector” issue before it affected the coming presidential contest.

The Washington state law at issue “reflects a tradition more than two centuries old,” she wrote. “In that practice, electors are not free agents; they are to vote for the candidate whom the state’s voters have chosen.”

In an opinion that referred to both the Broadway musical “Hamilton” and the HBO sitcom “Veep,” she added: “The state instructs its electors that they have no ground for reversing the vote of millions of its citizens. That direction accords with the Constitution—as well as with the trust of a nation that here, We the People rule.”