The major blunder that was the Iowa caucuses should never have happened, and the Iowa Democratic Party is roundly to blame for what amounted to a series of bad decisions leading up to the caucus itself. The events of Monday night were not a cosmic accident of epic proportions but instead, the results of abysmally poor planning.

The Iowa Democratic Party employed an app that was supposed to allow precinct chairs to record their results from each round of voting, while the app would perform the necessary calculations for determining the number of delegates awarded. Results were then to be sent to the Iowa Democratic Party from the app. In theory, it was beautiful and seamless. In reality, the system proved to be a nightmare.

Party officials in Iowa reported trouble transmitting results via the app, while frustrated precinct chairs sat on hold for hours trying to report results to the Iowa Democrat Party after the app failed and they were forced to resort to the “backup” phone system. There are some 1,700 caucus sites throughout the state of Iowa.

According to the New York Times, the app was not “properly tested at a statewide scale” before its usage in the Iowa caucus yesterday evening. Rather, it was an app that was quickly thrown together in the past two months by a vendor that the Iowa Democratic Party previously refused to disclose. Cybersecurity experts raised concerns back in January when the party made such a decision to keep the vendor under wraps.

The Wall Street Journal reported this morning that the cybersecurity wing of the Department of Homeland Security had offered to perform security tests on the app, but the Iowa Democratic Party rejected the offer. It’s unclear why such a decision was made, but it’s proving to be one of many blunders made by the Iowa Democratic Party.

“This app has never been used in any real election or tested at a statewide scale and it’s only been contemplated for use for two months now,” David Jefferson, a computer scientist at Lawrence Livermore National Laboratory and board member of the election integrity organization Verified Voting, told the New York Times.

The party received a series of warning signs on Monday. Even in the hours leading up to the caucus, state party officials were having difficulty downloading and logging onto the app. According to the Iowa Democratic Party, these troubles were the result of “poor cell service” or “minor user errors” that were being addressed. It’s unclear whether those issues were ever fully resolved before the caucus kicked off, and if they were not, concerns should have been appropriately raised.

It also was an egregious miscalculation to make the report phone line and the help phone line one and the same, a serious planning error that added to the chaos of the crashing app. “I had not expected it to be busy at 8 p.m.,” one precinct chair told the New York Times. “But if caucus chairs were calling for help at the same time that easy caucuses were trying to report results, the phones could have been overloaded.”

In total, while the app itself experienced tremendous failure, the Iowa Democrat Party engaged in terrible planning prior to the caucus, and set themselves up for disaster. In other words, Monday night didn’t need to spiral into absolute chaos with zero results being reported as of 9 AM the next morning, but because of certain decisions made by the state party, it unfortunately did.