fixed ngram bug