Fixing bug preventing proper upload of files