debug code for duplicate