 
     debug 'unshare user', username
 
+    { storage } = kd.singletons.computeController
+
     new Promise (resolve, reject) =>
       remote.api.SharedMachine.kick @uid, [username], (err) =>
         promise = @getBaseKite()
           .klientUnshare { username, permanent: yes }
+          .then => @users = @users.filter (user) -> user.username isnt username
           .then => @reviveUsers { permanentOnly : yes }
-          .then -> if err then reject new Error err else resolve()
+          .then =>
+            if err then reject new Error err else resolve()
           .catch reject
-
-
 
   shareUser: (username) ->
 


        @getBaseKite()
          .klientShare { username, permanent: yes }
          .then => @reviveUsers { permanentOnly : yes }
          .then resolve
          .catch reject

      .map (user) -> user.instance


  reviveUsers: (options, callback = kd.noop) ->

    { storage } = kd.singletons.computeController

    super options, (err, accounts = []) =>
      return callback err  if err

      debug 'reviveUsers', { accounts, machine: this }

      machineUsers = @getAt 'users'

      accounts.forEach (account) ->
        machineUser = _.find machineUsers, (user) ->
          user.username is account.profile.nickname

        if machineUser
        then machineUser.instance = account
        else machineUsers.push {
          username: account.profile.nickname
          instance: account
          permanent: yes
        }

      @setAt 'users', machineUsers

      storage.machines.push this

      callback null, accounts


  setLabel: (label, callback) ->
