avoided null pointer exception in parser