added error checking to GUI