bug fixing in grammar