small bug fix to tf-idf