duplicate entities in db fix