added parsing error checks