The Supreme Court dealt a blow to organized labor Wednesday morning when it ruled that state and local governments cannot require employees to pay fees to the unions that bargain on those workers’ behalf. The decision in Janus v. AFSCME presents a serious threat to unions that represent millions of schoolteachers, social workers, police officers, firefighters, and other public employees. But that serious threat need not become a fatal wound. State and local governments can take decisive steps to ensure that public sector unions remain financially viable, and they should act fast to stanch the outflow of funds from public sector unions in Janus’ wake.

Unions play an important role in raising workers’ wages, reducing racial and gender disparities in employee pay, and resolving workplace conflicts. But employees can reap the benefits of unionization without becoming union members, because unions generally have a legal obligation to represent all employees whether or not those employees join. Prior to Janus, nearly two dozen states had ensured public sector unions would be compensated for the cost of representing nonmembers by requiring those nonmember employees to pay “fair-share fees” that covered expenses associated with collective bargaining. Those fair-share fee requirements played an important role in maintaining organized labor’s strength in the public sector even as unionization rates in the private sector plummeted.

States should require public sector employers to subsidize unions directly.

More than 40 years ago, in Abood v. Detroit Board of Education, the Supreme Court held that fair-share fee requirements for public employees did not violate the First Amendment as long as those fees were used only to cover costs associated with collective bargaining and not for political campaigns or partisan activities. But by a narrow 5–4 margin on Wednesday, the court sent Abood to the dustbin, relying on the same “money is speech” logic that animated the controversial Citizens United decision. Fair-share fee arrangements violate the First Amendment, Justice Samuel Alito wrote for the majority, because they “requir[e] that all employees subsidize speech with which they may not agree.” This means state and local governments no longer can compel their employees to pay fair-share fees out of their own pockets.

The ramifications for public sector unions could be devastating. As Justice Elena Kagan said in a stinging dissent joined by Justices Ruth Bader Ginsburg, Stephen Breyer, and Sonia Sotomayor, Janus “wreaks havoc on entrenched legislative and contractual arrangements” in the 22 states, plus the District of Columbia and Puerto Rico, where fair-share fee arrangements are now in place. The decision, in her words, “creates a collective action problem of nightmarish proportions”: Because unions must represent nonmembers and members alike, many employees will decide that they don’t want to contribute to the cost of collective bargaining. The nation’s top economists agree: As three Nobel laureates explained in an amicus brief, the end of fair-share fee laws will allow for rampant “free-riding” in unionized workplaces. Indeed, we already see this very phenomenon in the states that don’t allow for fair-share fees: Free-rider rates are higher than 70 percent in some workplaces, and unions on the whole are much weaker as a result.

Yet the end of fair-share fee laws need not mean the demise of public sector unions in the states where those unions have so far stayed strong. As Justice Kagan notes, “State and local governments that thought fair-share provisions furthered their interests will need to find new ways of managing their workforces.” One such solution is at the ready: States can replace their fair-share fee laws with provisions that require or allow public sector employers to subsidize unions directly. While Wednesday’s ruling stops state and local governments from requiring their employees to make payments to unions out of those workers’ own pockets, it does not prevent state and local governments from supporting unions themselves. By supporting public sector unions directly, state and local governments can address the free-rider problem just as effectively as they could pre-Janus—and at no additional cost to their taxpayers—all while adhering to the Supreme Court’s constitutional pronouncements.

We proposed this approach—which we call “the direct payment alternative”—in a law review article published in 2015. Law professors Aaron Tang of the University of California, Davis, and Benjamin Sachs of Harvard have emphasized the viability of the direct payment approach as well. The basic idea is that instead of requiring a public employee to pay a fair-share fee to her union, a state or local government employer could reduce the employee’s salary by the amount of the fee and allocate that money to the union directly. For example, rather than pay a public employee $50,000 a year and require her to pay a $1,000 fair-share fee, a state or local government employer could pay the employee $49,000 and allocate the extra $1,000 to the union to cover collective-bargaining costs. Either way, the employer bears a $50,000 cost, while the employee comes away with $49,000 after accounting for her share of collective bargaining costs. And either way, the union receives $1,000 per employee to cover bargaining expenses.

If anything, the public employee would likely save money from this switch, due to a reduction in federal taxes owed. Under the fair-share fee approach, an employee who earned $50,000 would have to pay federal income taxes (and in most cases, also Social Security and Medicare taxes) on the whole amount, including on the $1,000 that goes straight to the union. (Employees used to be able to claim itemized deductions for union dues and fair-share fees, but a Republican Congress eliminated that deduction as part of the December 2017 tax law.) Under the direct payment alternative, the employee would have to pay federal income taxes only on the $49,000 that goes straight to her. In our example, the federal income tax savings would amount to about $120 per year. For some public employees with higher salaries and in higher tax brackets, the savings could be substantially more than that.

The direct payment alternative also addresses the First Amendment objection to fair-share fee laws that led to Janus. The plaintiff in Janus argued that the fair-share fee requirement violated his free speech rights because it forced him to support a labor union out of his own pocket. But he would have no such grounds for objecting if a state or local government made a direct payment to a public sector union. As then–Chief Justice William Rehnquist put it in Rust v. Sullivan in 1991, “[t]he Government can, without violating the Constitution, selectively fund a program to encourage certain activities it believes to be in the public interest.” And the court has defined “public interest” broadly—even an ad campaign to encourage Americans to eat more beef counts. We see no constitutional reason why a state government’s choice to support collective bargaining among its employees would not qualify as a permissible “public interest” too.

The bigger obstacles to the direct payment alternative are likely psychological and political.

First, public employees would have to be persuaded that their real wages aren’t being cut even if their nominal salary goes down. Fortunately, public employees are on the whole a highly educated group, and unions should be able to explain in clear terms why the direct payment alternative leaves most employees better off.

Second, some union leaders might not like the looks of being funded by the government employer that sits on the other side of the negotiating table. But fair-share fees were just as dependent on government approval: They existed only because state laws either mandated them or expressly permitted them to be added to collective bargaining agreements. (Indeed, 28 states had already disallowed fair-share fees in some or all public sector workplaces, with Republican-dominated state governments in states such as Michigan recently outlawing the practice.) Fair-share fees existed only because some state governments chose to facilitate the flow of funds to the unions with whom they bargain. The difference is simply between the state requiring its employees to pay fees to a union and the state paying those fees to the union itself.

A third hurdle—and probably the most significant of all—is legislative. Today, nearly every state that permits or requires fair-share fees also effectively prohibits public employers from making direct contributions to labor unions. To replace fair-share fees with the direct payment alternative, states will need to change their existing laws.

In some states that currently require public employees to pay fair-share fees, legislative change might be impossible given current political circumstances. For example, in Illinois—the state whose law was challenged in the Janus case—Republican Gov. Bruce Rauner is an avowed enemy of public employee unions and would almost certainly veto any legislation that strengthens their hand. In the eight states where Democrats control the governorship and both houses of the state legislature, however, legislative change might not be out of reach. Indeed, in one of those eight states, Hawaii, the process has already begun. Shortly after we first proposed the direct payment alternative, state Rep. Marcus Oshiro introduced a bill that would set up such a system for public employees in Hawaii. And with 27 Republican-held governor’s mansions and thousands of state legislative seats up for election this November, unions may have the opportunity to expand the number of jurisdictions that would be likely to support the direct payment alternative.

The silver lining for public sector unions is that while the Supreme Court has disallowed fair-share fees, the direct payment alternative offers a constitutionally permissible substitute. If government employees and their allies can persuade state lawmakers to act, they can ensure that—notwithstanding Wednesday’s decision—public sector unions will live another day.