avoid generating uncaught exceptions in app