better parser error handling