Added handler of exception.