Added catch-all exception handler