rem_duplicates fix