Fixes duplicates problem