add try clause to ngrams