   @returns {undefined}
   ###
   _handleUpload: if Meteor.isServer then (result, opts, cb) ->
-    self = @
     try
       if opts.eof
+        self = @
         @_currentUploads[result._id].end -> bound ->
           self.emit '_finishUpload', result, opts, cb
           return
       else
         @_currentUploads[result._id].write opts.chunkId, opts.binData, cb
     catch e
+      console.warn "[_handleUpload] [EXCEPTION:]", e if @debug
       cb and cb e
     return
   else undefined

        return

      @_createStream = (_id, path, opts) ->
        return self._currentUploads[_id] = new writeStream path, opts.fileLength, opts

      # This little function allows to continue upload
      # even after server is restarted (*not on dev-stage*)
      @_continueUpload = (_id) ->
        if self._currentUploads?[_id]?.file
          unless self._currentUploads[_id].stream._writableState.ended
            return self._currentUploads[_id].file
          else
            self._createStream _id, self._currentUploads[_id].file.file.path, self._currentUploads[_id].file

                  {result, opts}  = self._prepareUpload _.extend(opts, _continueUpload), user.userId, 'HTTP'

                  if opts.eof
                    self._handleUpload result, opts, ->
                      response.writeHead 200
                      result.file.meta = fixJSONStringify result.file.meta if result?.file?.meta
                      response.end JSON.stringify result
                      return
                    return
                  else
                    self.emit '_handleUpload', result, opts, NOOP

