remember type of references; add_ids return the set