Creating error checks