enhance the exception handle