Fixed duplicates bug