On Tuesday evening, progressives were celebrating the results for the Wisconsin Supreme Court race. And for good reason: a 56 percent to 44 percent win for a liberal candidate, Rebecca Dallet, in a state that Trump had won is a big deal. But the event itself is nothing to celebrate. Judicial elections—and especially non-partisan judicial elections—are bad for law and democracy.

About 90 percent of state judges face some kind of election. States turned to judicial elections with the best intentions in the 19th century. As I explained in my book The People’s Courts, Americans had witnessed the problems with partisan judicial appointments to relatively short terms. Judges had remained captured by party bosses and politicians, and they were unwilling to stand up to the abuses by the political branches. American reformers thought the elections would promote judicial independence by insulating judges from partisanship.

Their naivete is on display throughout American today.

Instead of judges beholden to the inside politics of appointment and reappointment, they are now beholden to special interests, campaign financiers, and the manipulations of negative advertising. Competitive state supreme court races usually cost many millions of dollars, often raised from parties with pending cases or interest groups with something at stake in those cases. And many states have partisan elections, which makes those judges reliant on partisan support.

Reformers have tried to address this problem by adopting non-partisan election systems. For example, Wisconsin has multiple judicial candidates run in a non-partisan open primary to select two candidates for a general election with no party labels. These efforts have also backfired. One of the main problems with judicial elections is that voters do not know enough about the candidates to make a meaningful choice. But as long as voters already have so little information, removing the party identification from the ballot gives voters even less information. A “D” or an “R” by a name might not very helpful, but party labels do give us at least a good hint about the candidates’ leanings on major questions. If you take that hint away, it turns out that voters depend on worse signals: first and last names as a hint about sex, race, and ethnicity. Voters choose names that are familiar, not foreign. They sometimes pick judges who happen to have the same names as celebrities and sports heroes.

These type of non-partisan reforms also backfire by forcing candidates to replace the party ID signal with even more advertising, and even nastier campaigns, funded by even more special interest money. If they can’t reply on the party label hint, they choose to try to destroy their opponents’ reputations.

Wisconsin has become one of the worst examples. It was once a state with relatively civil elections. But over the past decade, its judicial elections have become infamously nasty. Wisconsin’s first black justice, Louis Butler, ruled against lead paint manufacturers, and then he was targeted by business interest groups. In 2008, his challenger, Michael Gableman, who had almost no appellate experience, ran a race-baiting Willie Horton-style ad campaign that grossly distorted Butler’s record, blaming him for a rape to which he had zero connection.

The ad put Butler’s face side-by-side with the face of Mitchell, the black man who had been convicted of rape. A narrator says, “Butler found a loophole. Mitchell went on to molest another child.” The ad implies that Butler as a judge put Mitchell back on the street. In fact, Butler was a public defender representing Mitchell on appeal. A lower court agreed with Butler’s constitutional argument, but the Wisconsin Supreme Court overturned that decision, anad Mitchell served his full sentence. Three years after his release, Mitchell committed another crime, not connected with Butler’s work at all. Gableman won.

Three years later, groups on the left attacked Judge David Prosser during his re-election campaign, distorting his record as a prosecutor for not bringing charges against a priest accused of child abuse. Prosser nevertheless won, but soon thereafter, he was accused of putting his hands around the neck of his colleague Judge Ann Bradley.

These nasty races may have been a factor in the collapse of civility on Wisconsin’s state bench.

What are the solutions? Old-school appointments by governors are no panacea. But there is a fix that many states have turned to that has shown promise: a merit system for nominating judges.

Merit commissions generally are composed of leaders of the state bar, representatives of the legislature, appointees by the governor, and often a chief judge or retired judge. They select three names, from which the governor nominates one, pending state senate confirmation. After a few years on the bench, they face a yes-or-no retention election.

This system is also not perfect. It doesn’t yield the most “meritorious” candidates, nor the most diverse slate of candidates, but it tends to weed out the cronies and the ideologues. Moreover, retention elections tend to be much less expensive than the competitive systems. Special interests seem to be eager to spend on a hand-picked candidate, but they’re less willing to spend if they are only able to remove a judge, who will be replaced by the same merit system that had picked him or her.

Incumbents overwhelmingly win these retention elections, which helps promote job security and thus judicial independence. Maybe merit re-appointment would be better than any kind of election, but these retention elections are an acceptable compromise with those who seek some degree of public accountability.

Should Democrats be happy about the specific result in Wisconsin? Sure. But the more general results of judicial elections are judges less willing to protect minorities, criminal defendants, consumers, and the public interest, and more beholden to party politics and special interests. Judicial elections sound like more democracy, but judges need to be independent from elections and party politics if they are supposed to protect the rules of elections and democracy from partisan manipulation and abuse.

If you care about constitutional democracy, don’t just help get your judicial candidate elected. Help end partisan and non-partisan judicial elections.

Jed Shugerman is a law professor at Fordham, the author of The People’s Courts (Harvard U. Press 2012), and a co-author of a legal historians’ brief in the Emoluments cases against President Trump.