add uncaughtException handling