     console.log "worker lost",data
     for w,x of jobInfo.workers
       x.active = false if w == data.from
-    flushWorkers()
+    flushWorkers(data.from,jobInfo.workers[data.from])
     $('td.tsourceNum').text (w for w,x of jobInfo.workers when x.active).length
     if (w for w,x of jobInfo.workers when x.active).length > 0
       $('td.tstate').text 'running...'

  jobInfo = 
    workers: {}

  flushWorkers =  ->
    for from,w of jobInfo.workers
      if $(".workers-list li##{from} .twinkle").length > 0
        if w.active
          $(".workers-list li##{from} .twinkle").addClass('twinkle-on')
        else
          $(".workers-list li##{from} .twinkle").removeClass('twinkle-on')
        $(".workers-list li##{from} input.worker-visible").prop "checked", w.visible 
      else
        style = if w.active then 'twinkle-on' else ''
        workerVisible = if w.visible then 'checked' else ''
        $(".workers-list").append "<li id='#{from}'>
        <div class='twinkle #{style}'></div>
        <input type='checkbox' name='#{from}' class='worker-visible' #{workerVisible}>
        <a href='#' class='worker-detail'>#{from}</a>
        </li>"
      if $(".terminals .term-#{from}").length == 0 and w.visible
        htmlStr = "<div class='row term-#{from}'>
          <div class='col-lg-12'>
            <div class='shell-wrap'>
              <div class='titlebar'>
                <div class='buttons'>
                  <div class='close'>
                    <a class='closebutton' href='#' id='#{from}'><span><strong>x</strong></span></a>
                  </div>
                </div>
                node: #{from}
              </div>
              <ul class='shell-body'>
                <li class='cursor'>loading output......</li>
              </ul>
            </div>
          </div>
        </div><br/>"
        $('.terminals').append htmlStr
      act = if w.visible then 'show' else 'hide'
      $(".terminals .term-#{from}")[act]('fast')

    $('a.worker-detail').off('click').on 'click', ->
      workerId = $(this).text()

    onlyOne = (w for w,x of jobInfo.workers).length == 1
    jobInfo.workers[data.from].active = true
    jobInfo.workers[data.from].visible = true if onlyOne
    flushWorkers(data.from,jobInfo.workers[data.from])
    $('td.tsourceNum').text (w for w,x of jobInfo.workers when x.active).length
    if (w for w,x of jobInfo.workers when x.active).length > 0
      $('td.tstate').text 'running...'
