Fixed issue with uncaught exceptions