Added protection against duplicate ids in imported data