more error checks