 
   handleMachineSettingsClick: (event) ->
 
-    machine    = @getData()
-    { status } = machine
+    { status } = @machine
     { Building, Running } = Machine.State
 
     kd.utils.stopDOMEvent event
 
     if status?.state is Running
-      kd.singletons.mainView.openMachineModal machine, this
+      kd.singletons.mainView.openMachineModal @machine, this
     else return
 
 


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

    machine      = data
    @alias       = machine.slug or machine.label
    ideRoute     = "/IDE/#{@alias}/my-workspace"
    machineOwner = machine.getOwner()
    isMyMachine  = machine.isMine()
    channelId    = ''

    if not isMyMachine and globals.userWorkspaces
      globals.userWorkspaces.forEach (ws) ->
        return if channelId

        if ws.machineUId is machine.uid and ws.channelId
          channelId = ws.channelId

      ideRoute = if channelId
        "/IDE/#{channelId}"
      else
        "/IDE/#{machine.uid}/my-workspace"

    options.tagName    = 'a'
    options.cssClass   = "vm #{machine.status.state.toLowerCase()} #{machine.provider}"
    options.attributes =
      href             : groupifyLink ideRoute
      title            : "Open IDE for #{@alias}"

    unless machineOwner is nick()
      options.attributes.title += " (shared by @#{htmlencode.htmlDecode machineOwner})"

    super options, data

    @machine   = @getData()

    labelPartial = machine.label or @alias

    unless isMyMachine

    @progress  = new KDProgressBarView
      cssClass : 'hidden'

    if @machine.isMine()
      @settingsIcon = new KDCustomHTMLView
        tagName     : 'span'
        click       : @bound 'handleMachineSettingsClick'
