fixed save_tf in add_document