added check for grammar file to be filtered