fixed the ngram query tool