fixed bugs in parser