better handling of dupes