error handling by the time of error