update to error checks