fixed bug in TF-IDF generation