fixed a bug in rm
state stack for parser