updated to prevent duplicates