removing entity id duplication