fixed some bugs for parser