Fix duplicates bug