Kim Davis confounded the pollsters and propelled an underdog candidate, Matt Bevin, to victory in the Kentucky governor’s race. Nearly two-thirds of voters in Ohio rejected marijuana. And citizens in Houston vetoed their city council and rejected a bad policy on sexual orientation and gender identity.

Conventional wisdom is that social liberalism is an electoral winner, but that’s not true. At least not in the swing states of Kentucky and Ohio, and not even in the liberal city of Houston. And definitely not last night.

There is a lesson to be learned: Conservatives can win when they refuse to be bullied by elites into silence. Making the public argument against bad policy and in support of good policy can win the day. It just did.

As the Washington Post’s “Daily 202” notes, a major factor in Bevin’s victory—a Republican in a state that has elected Democrats as governor for 40 of the past 44 years—was “[f]ocusing on social issues, including promises to defund Planned Parenthood and defend Kim Davis, [which] helped drive the conservative base to turn out.”

No one was predicting that Bevin would win, especially not after he publicly defended Kim Davis and vigorously criticized the current governor for his handling of that situation. As I argued in the New York Times, Kim Davis didn’t need to go to jail, if only the political leaders of Kentucky been willing to work together to find a commonsense compromise.

The media made a circus of the situation, and now Governor-elect Bevin has the opportunity to work with the state legislature to enact commonsense religious accommodation law for clerks and magistrates , like North Carolina has done.

Kentucky needs to create an accommodation only because the Supreme Court redefined their marriage law. This highlights an important reality: Exemptions and accommodations are necessary, especially if bad policy becomes law.

It is much better to simply prevent bad public policy from ever going into effect as law. That’s what the citizens of Houston did yesterday.

Don’t let the media demagogue and attack the people of Houston. Citizens there voted three times to elect Annise Parker, a lesbian, as mayor. They’re a tolerant city. But they drew the line when the city council voted to create special privileges based on sexual orientation and gender identity that could have been used to shutter faith-based adoption agencies; penalize florists, photographers, and bakers; and force businesses to allow biological males who identify as women into women’s restrooms and changing rooms.

Citizens in Houston organized against the city council and collected more than enough signatures required to put the issue to a vote of the people. But the mayor claimed that the majority of signatures were invalid and refused to put the issue on the ballot. Then she subpoenaed the sermons of five prominent pastors who helped lead the charge against the measure. After a public outcry, the mayor relented on the sermons, and a unanimous state Supreme Court said the signatures were valid and the citizens had to vote on the measure.

And the citizens won.

Against one-sided media coverage, big business lobbying, and various elites expressing their support for the ordinance, a grassroots coalition of ordinary citizens were able to explain why sexual orientation and gender identity laws are bad policy.

This needs to continue, both in Houston and across the country. For as Ed Feulner was fond of reminding people, in politics, there are no permanent defeats, because there are no permanent victories. Sexual orientation and gender identity laws are being pushed across the nation, at the federal, state, and local levels. They are unnecessary and divisive and must be resisted.

Some people suggest that the best Americans can hope for is passage of these laws with some religious exemptions and accommodations. But Houston shows us a better way. Don’t enact bad policy that you’d need to exempt yourself from in the first place.

As we are now one year away from the 2016 general election, Americans would do well to remember this lesson from the 2015 election. Stand on principle. Make the public argument. Defeat bad policy. Enact good policy.