smarter logic for dups
fix