change duplicate logic