LUN-1164: fixed recursion error when copy folder to itself