               user: -> if Meteor.users then Meteor.users.findOne(@userId) else null
             }
 
-            unless self.onBeforeRemove.call userFuncs, (self.find(search) or null)
+            unless self.onBeforeRemove.call userFuncs, (self.find(selector) or null)
               throw new Meteor.Error 403, '[FilesCollection] [remove] Not permitted!'
 
-          self.remove search
+          self.remove selector
           return true
         else
           throw new Meteor.Error 401, '[FilesCollection] [remove] Run code from client is not allowed!'

  bound = Meteor.bindEnvironment (callback) -> return callback()

  ###
  @locus Server
  @class writeStream
  @param path      {String} - Path to file on FS

      else
        return true

    @_methodNames =
      MeteorFileAbort:  "MeteorFileAbort#{@_prefix}"
      MeteorFileWrite:  "MeteorFileWrite#{@_prefix}"
      MeteorFileStart:  "MeteorFileStart#{@_prefix}"
      MeteorFileRemove: "MeteorFileRemove#{@_prefix}"

    if Meteor.isServer
      @on '_handleUpload', @_handleUpload
      @on '_finishUpload', @_finishUpload

      WebApp.connectHandlers.use (request, response, next) ->
        if !!~request._parsedUrl.path.indexOf "#{self.downloadRoute}/#{self.collectionName}/__upload"
