Fixing bug with Write to Folder