bug fixed for term frequency