updated parser error handling