       requiredFields = requiredData[provider]
       fields = requiredFields.map (field) -> field.name ? field
 
-      helpers._loadCredentials { provider, fields }, stack.credentials, (err, data) ->
+      helpers._loadCredentials { provider, fields }, (err, items) ->
         return callback err  if err
-        data.fields = requiredFields
-        callback null, data
+        callback null, { items, provider, fields : requiredFields }
 
 
     getKDCmd: (callback) ->

        break  if provider in ['aws', 'vagrant']
      provider ?= (Object.keys stack.credentials ? { aws : yes }).first

      helpers._loadCredentials { provider }, stack.credentials, (err, result) ->
        return callback err  if err

        { items, defaultItem } = result
        return callback null, result  unless defaultItem

        isAvailable = (


  helpers =

    _loadCredentials: (selector, callback) ->

      remote.api.JCredential.some selector, { '_id' : -1 }, callback


    loadCredentials: (stack, callback) ->
