Added back check for duplicates.