term weight and fix a bug about multiple indexing