   $spawn       = $ '#spawn'        ; $cancel      = $ '#fav-cancel'
   $spawnStatus = $ '#spawn-status' ; $listen      = $ '#listen'
   $about       = $ '#about'        ; $listenPort  = $ '#listen-port'
-  $listenDialog = null
+  $listenDialog = $connectDialog = null
 
   enableSpawnAndListen = (b) ->
     $('#spawn, #listen').button if b then 'enable' else 'disable'

        ]
      return
    .on '*hijacked', ({addr}) -> $.alert "#{addr} has taken over usage of this proxy.", 'Disconnected'; return
    .on '*connected', ({host, port}) -> $listenDialog?.dialog 'close'; ideInstance = ide(); ideInstance.setHostAndPort host, port; return
    .on '*connectError', ({err}) -> $.alert err, 'Error'; return
    .on '*spawned', ({pid}) ->
      $spawnStatus.text "PID: #{pid}"
      enableSpawnAndListen false; return

      $spawnStatus.text(if code? then "exited with code #{code}" else "received #{signal}")
      enableSpawnAndListen true; return
    .on '*listenError', ({err}) ->
      if $listenDialog then $listenDialog.dialog 'close'; $listenDialog = null
      $.alert err, 'Error'; enableSpawnAndListen true; return

  $('#fav-list').resizable handles: 's,e'

