fix bug in copyFile & copyDir