Added exception handler.