handle duplicated ids when associating products