fix set_ids method (keep given ids order)