fixed creating directories.