fixed global leak in listTerms