         credentials :
           title     : 'Credentials'
           cssClass  : 'credentials show-controls has-markdown'
-          view      : @credentialsController.getView()
+          view      : @controllers.credentials.getView()
           controls  :
             plus    : =>
-              @credentialsController.getCredentialAddButton()
+              @controllers.credentials.getCredentialAddButton()
 
     @emit 'ready'
 
 
   setTemplateData: (data, reset = no) ->
+
+    debug 'setTemplateData with args:', data, reset
 
     { _id: id, title, description, template } = data
     unless id or description or template

      @statusbar
    }

    @logsController = new LogsController
      editor: @logs

    @variablesController = new VariablesController
      editor: @variables
      logs  : @logsController

    # SideView for Search and Credentials
    @credentialsController = new CredentialsController
      logs  : @logsController

    @sideView       = new SideView
      title         : yes


    @setData data
    @toolbar.setData data
    @controllers.variables.setData data
    @controllers.credentials.setData data

    @_saveSnapshot @_current  if @_current
    @_deleteSnapshot id  if reset
