fixing case where id list is empty