update the error number when having an error