fixed weighting bug in tf-idf