inline the error checks.