Bugfix for duplicates