correct duplicate ids