fix bad duplicates removal