Added actual directory creation code before copying of files.