Added an error dialog function to replace all of the separate error messages