         relSelector.as = selector.as
         delete selector.as
 
-      Relationship.someData relSelector, { targetId:1, as:1 }, (err, cursor)=>
+      Relationship.someData relSelector, { targetId:1, as:1 }, (err, cursor) =>
 
         return callback err  if err?
 
-        cursor.toArray (err, arr)=>
-
-          map = arr.reduce (memo, doc)=>
+        cursor.toArray (err, arr) =>
+
+          map = arr.reduce (memo, doc) ->
             memo[doc.targetId] = doc.as
             memo
           , {}
 
           selector    ?= {}
-          selector._id = $in: (t.targetId for t in arr)
-
-          @some selector, options, (err, items)->
+          selector._id = { $in: (t.targetId for t in arr) }
+
+          @some selector, options, (err, items) ->
             return callback err  if err?
 
             for item in items

      { permission: 'update credential', validateWith: Validators.own }
    ]

    success: (client, callback)->

      Relationship.someData targetId : @getId(), {
        as:1, sourceId:1, sourceName:1
      }, (err, cursor)->

        return callback err  if err?

        cursor.toArray (err, arr)->
          return callback err  if err?

          if arr.length > 0

    if delegate.profile.nickname is target
      return callback null

    JName.fetchModels target, (err, result) =>

      if err or not result
        return callback new KodingError 'Target not found.'

      { models } = result
      [ target ] = models

      if target instanceof JUser
        target.fetchOwnAccount (err, account) =>
          if err or not account
            return callback new KodingError 'Failed to fetch account.'
          @setPermissionFor account, { user, owner }, callback

      else if target instanceof JGroup
        @setPermissionFor target, { user, owner }, callback

      else
        callback new KodingError 'Target does not support credentials.'


  # .share can be used like this:
