Added folder creation to copyFile()