 
   updateStackTemplate = (data, callback) ->
 
-    { template, credential, title, stackTemplate, machines } = data
+    { template, templateDetails, credential
+      title, stackTemplate, machines } = data
 
     title     or= 'Default stack template'
     credentials = [credential.publicKey]  if credential
 
     if stackTemplate
       dataToUpdate = if machines \
-        then {machines} else {title, template, credentials}
+        then {machines} else {title, template, credentials, templateDetails}
       stackTemplate.update dataToUpdate, (err) ->
         callback err, stackTemplate
     else
       remote.api.JStackTemplate.create {
-        title, template, credentials
+        title, template, credentials, templateDetails
       }, callback
 
 

      {provider, credential, stackTemplate, template} = data or {}

      container = @views.container 'step-define-stack'
      content   = stackTemplate?.template?.content or \
                  template?.content or DEFAULT_TEMPLATE

      views     = @addTo container,
        stepsHeaderView : {steps, selected: index}
        input_title     :
          label         : 'Stack Template Title'
          value         : stackTemplate?.title or 'Default Template'
        editorView      : {content}
        navCancelButton :
          title         : '< Boostrap Credential'

          cssClass      : 'solid compact green nav next'
          callback      : ->

            {title} = views.input_title.getData()
            templateContent = views.editorView.getValue()

            updateStackTemplate {
              template: templateContent, templateDetails
              credential, stackTemplate, title
            }, (err, _stackTemplate) ->
              return  if showError err

              data.stackTemplate = _stackTemplate
              callback data

      return container

