finish the exception handling