Fixed an error with duplications