added statement to catch all uncaught exceptions