fixed memory leak in parser