add exception handler.