fix thesaurus memory bug