new generated ids
improved duplication check