grammar recognition bug fix after speed up