add better parser error checking