adding check to handle bad lexicon issues