Fix saving files to not existing directory