Fix bug where multiple instances of error dialog could be created