Check for duplicate ids