fixed bug in grammar module