better parsing error catching