Norman Eisen, a CNN contributor, is a senior fellow in Governance Studies at the Brookings Institution. He served as President Obama's ethics czar from 2009-11 and as US ambassador to the Czech Republic from 2011-14. The views expressed in this commentary are his own.

(CNN) The latest reporting regarding the scope of attempted Russian cyber-interference in the 2016 presidential election suggests election officials made a mistake in ending efforts to recount the contest in key states.

Those recounts offered the best opportunity to identify and resolve issues that are now coming to light. We should study our errors to avoid repeating them -- and to make sure recounts in the future are better at detecting hacking and other threats.

Post-election efforts to recount the 2016 presidential vote did not get far. For example, the Michigan recount was shut down after just three days ; a federal judge rejected a request to recount paper ballots in Pennsylvania; and while Wisconsin did conduct a recount, in many counties, officials neglected to hand-count paper ballots and did not examine vulnerable software in electronic voting machines.

Just as Donald Trump continues to resist the finding that Russia manipulated our democratic process, he furiously contested the need to investigate the vote. His campaign and the Republican Party engaged in court battles to block the recounts in all three states. The exact outcome varied from jurisdiction to jurisdiction, but the bottom line was the same.

While no one should yet jump to the conclusion that Russian efforts to manipulate the vote were successful in changing its outcome, the risks were, in retrospect, sufficient to merit heightened scrutiny. We knew that the Russians had engaged in untoward activity. We were aware, too, that American elections are not as secure as they should be.

One clear area of vulnerability then and now is our reliance on electronic voting machines and vote tabulating machines without conducting any meaningful post-election audits. Like any other technology, these devices can fail in unexpected ways. They can have bugs that might produce an incorrect result. When irregularities occur in an election -- such as the approximately 84,000 ballots in Michigan on which there were reportedly no selections marked for president -- we need to see if an error is to blame.

What's worse, according to Verified Voting, a organization that advocates for transparency in elections, in America, almost a quarter of voting machines do not leave a paper record of votes cast -- meaning that if a glitch or error occurs, there are no physical votes to cross-check. They effectively vanish just as they are cast. That's why these machines are banned in many states and elsewhere around the world, including in Germany

Indeed, it has been shown repeatedly that our voting machines are vulnerable to being hacked. Election security experts agree that the task would not be difficult for hackers who are sufficiently skilled and motivated.

These hackers could come from anywhere. They could be thrill-seeking teens powered by adrenaline and Red Bull and furiously clattering away on their keyboards,or "someone sitting on their bed that weighs 400 pounds," as Trump famously speculated in a presidential debate. They could conceivably be corrupt American partisans seeking to distort outcomes to favor their chosen candidate. Or, as we have seen , they could be professional cyberwarfare experts deployed on behalf of a hostile nation's interests.

Of course, it was understandable that after such a protracted campaign, many wished to simply move on. A recount runs counter to the emotional need to close the door on 2016's bitter election and look to the future.

But we cannot be complacent about our democracy. Sure, recounts are burdensome -- both because of the bureaucratic hurdles that state systems have erected and because requests for them get bogged down in partisan courts. But they are regrettably necessary at times. 2016 was one of those times.

The 2004 Ohio recount of the presidential vote, initiated by the Libertarians and the Green Party, illustrated why recounts can be worth the trouble. It did not change the result: George W. Bush still won the state and, in turn, the White House. But it did uncover serious problems with the voting process -- including erroneously disqualified ballots and broken machines -- and eventually resulted in convictions and jail time for two local election officials.

The 2004 recount was vital to protecting American democracy. It exposed the flaws during that vote and sent a message that those who abuse our electoral system will be punished. Although I am a Democrat who served as an election protection lawyer for the Kerry campaign in 2004, I was proud to act as co-lead counsel for the Ohio recount for those very reasons.

Follow CNN Opinion Join us on Twitter and Facebook

Going forward in future elections, we must make our electoral system more secure. We have to ensure that recount efforts aren't so messy and time consuming. Universal paper ballot-based systems across the country and regular checks designed to spot unusual results -- known as risk-limiting audits -- are critical to restore public confidence in our voting system. Until then, our system remains deeply vulnerable to errors and attacks. And without recounts we might never know they have happened.

Americans' trust in our system of governance is already too low. It turns out that our failure to conduct thorough recounts made it worse. Until we take decisive measures to rebut the threat from unreliable machines and hackers, we are actively allowing doubt over the integrity of our elections to multiply.

America cannot afford this level of uncertainty. Until our elections are safer and more secure, recounts are sometimes necessary to show that our system works.

We missed that opportunity in 2016. Let's not repeat the same mistake going forward.