enhanced duplicate handling