fixed bug: after finding duplicate it attempts to copy by renaming