minor error checks