fixed handling of words not in database