Changed all where directory does not exist to create directory.