Fixed the IllegalStateException issue. Fixed the bug where clicking on
export after exporting a file would trigger another export.
Might have to add a message like "Export successful", yet the download
dialog should be sufficient to show the user the export was in fact
successful.