Add logic to avoid duplicates