       { timeout } = KONFIG.collaboration
 
       if (Date.now() - lastSeen.getTime()) > timeout
-      then unshareMachine workspace, callback
+      then unshareMachine channelId, callback
       else callback 'host is alive'
 
 
-  @add = secure (client, machineUId, target, callback) ->
+  @add = secure (client, channelId, target, callback) ->
 
     asUser  = yes
     options = { target, asUser }
-    setUsers client, machineUId, options, (err, machine) ->
+    setUsers client, channelId, options, (err, machine) ->
       return callback err  if err
 
-      data =  { machineUId, group: client?.context?.group }
+      data =  { channelId, group: client?.context?.group }
 
       notifyByUsernames options.target, 'CollaborationInvitation', data
 
       callback()
 
 
-  @kick = secure (client, machineUId, target, callback) ->
+  @kick = secure (client, channelId, target, callback) ->
 
     asUser  = no
     options = { target, asUser }
-    setUsers client, machineUId, options, callback
+    setUsers client, channelId, options, (err, machine) ->
+      callback err, machine
 
 
-  setUsers = (client, machineUId, options, callback) ->
+  setUsers = (client, channelId, options, callback) ->
 
     options.permanent = no
-    JMachine.shareByUId client, machineUId, options, callback
+    JMachine.one { channelId }, (err, machine) ->
+
+      return callback err  if err
+      return callback new KodingError 'Machine not found'  unless machine
+
+      machine.shareWith$ client, options, (err) ->
+        callback err, machine

      machine.update { $set: { users: [owner] } }, callback


  @stop = secure authenticated (client, fileId, workspace, callback) ->

    getRealtimeDocument fileId, (err, doc) ->


    return google_utils.authenticated options, method


  unshareMachine = (channelId, callback) ->

    JMachine.one { channelId }, (err, machine) ->
      owner = null

      for user in machine.users when user.sudo and user.owner
