small fix in the error handling