Fix event handlers
Add function to modify `sys.excepthook`  to display error dialog for unhandled exceptions