add showDuplicate flag and fix dupe bug