fixed major issue with duplicates