better handling potential dup flag, also on index