If you see thousands of children in West Virginia out of school this week, rest assured they are not playing hooky.

In fact, it’s their teachers who are.

Last week, a massive strike of almost 20,000 teachers occurred in the state, leading to widespread school closures. On Tuesday, every single public school in West Virginia was closed.

Despite several failed negotiation attempts, West Virginia Gov. Jim Justice finally struck a deal with the teachers and their union representation. As a result, children in West Virginia will be able to return to school on Thursday.

West Virginia public schools are certainly in trouble. Only 33 percent of fourth-graders are proficient in math, while only 27 percent of eighth-graders are proficient in reading, according to the 2015 National Assessment of Educational Progress. Additionally, West Virginia ranks 48th in the United States for teacher pay.

But a massive teacher walkout leaving nearly 300,000 children without an education and working parents in a childcare pinch is not the solution to the troubles facing West Virginia public schools.

One reason teacher pay for many might be lower than they deserve? Unions. Unions, which hold significant political power, such as the American Federation of Teachers and the West Virginia Education Association, claim to represent the needs of teachers. But in fact, such unions may serve as a significant barrier to reforming teacher compensation.

For instance, paying teachers based on performance would enable effective teachers to be recognized and financially rewarded for good work. Unfortunately, union-backed policies such as compensation based on years in the school as opposed to impact on students’ achievement fail to adequately recognize good teachers, and remove strong incentives for poor teachers to raise the bar.

Instead of walking out of their classrooms, an action that hurts children, teachers should be turning their attention to how the policies pushed by unions run counter to their interests as professionals.

Matthew Ladner and co-authors Mark Francis and Greg Stone explain in a paper for the Goldwater Institute how a combination of performance pay, improved teacher evaluation, and an option of modestly larger classes could easily enable schools to pay their “rock star teachers” more than $100,000.

As they note, “the United States has made a tragic error in emphasizing teacher quantity (through efforts to limit average class size) rather than teacher quality. The growing literature on student learning gains clearly demonstrate that teacher quality trumps the impact of class size variation by a wide margin.” Moreover, school choice programs could alleviate many of these issues.

As I have previously argued, there is no limit to what a teacher can earn under an education savings account model. Why not reward good teachers by allowing parents to pay a teacher directly, using state funds, for giving their child a customized math curriculum? A system that breaks apart the education bureaucracy and truly allows teachers to thrive and earn as much as they deserve is vastly superior to the union-dominated near-monopoly that exists in traditional districts.

And of course, it’s worth noting that while teachers may be making less than they deserve in the current system, union officials aren’t being hurt: union employees at the West Virginia Education Association average almost six figures, far exceeding the average teacher in the state making $45,622.

As teachers and students return to school on Thursday, parents should encourage policymakers to pursue policies, such as merit pay and school choice, that would break the public education monopoly status quo. More bureaucracy and union policies have not worked out well for students in West Virginia—or their teachers.