       click : ->
         kd.singletons.router.handleRoute '/Home/Stacks/virtual-machines'
 
-    @addSubView new kd.CustomHTMLView
+    @addSubView @backLink = new kd.CustomHTMLView
       cssClass : 'pane-header'
       partial : """
-        <div class='vm-name'> #{@machineName} Build Logs </div>
+        <div class='vm-name'> #{machineName} Build Logs </div>
         <div class='title'> /var/log/cloud-init-output.log</div>
       """
 
-    @addSubView new IDETailerPane { cssClass: 'build-logs-view', @file, delegate: this }
+    @addSubView @tailer = new IDETailerPane { cssClass: 'build-logs-view', file, delegate: this }
+
+
+  destroyViews: ->
+
+    @header?.destroy()
+    @backLink?.destroy()
+    @tailer?.destroy()
+

        IDEHelpers.showFileAccessDeniedError()
        return router.handleRoute '/Home/Stacks/virtual-machines'


  viewAppended: ->

    @addSubView @header = header()



  constructor: (options = {}, data) ->

    options.cssClass = kd.utils.curry 'Build-Logs', options.cssClass

    super options, data


  handleAction: (uid) ->

    @destroyViews()

    { computeController } = kd.singletons

    machine = computeController.findMachineFromMachineUId uid
    path = ''
    return router.handleNotFound path  unless machine

    machineName = machine.label

    # Path of cloud-init-output log
    path = '/var/log/cloud-init-output.log'
    file = FSHelper.createFileInstance { path, machine }

    file.fetchPermissions (err, result) =>

      return showErrorNotification err  if err

