handle some errors in parsing