completing copydirectory implementation