         console.log 'Connected'
         # client.write 'info break'
         return
-      @client.on 'data', (data) ->
+      @client.on 'data', (data) =>
         console.log 'Received: ' + data
+        @handleCmd(data)
         # client.destroy()
         # kill client after server's response
         return

      # Create message element
      message = document.createElement('button')
      message.textContent = "Run cmd: " + cmd
      message.addEventListener 'click', => @client.write(cmd + "\n")
      # message.classList.add('message')
      @element.appendChild(message)


    message.textContent = "Run cmd: " + cmd
    message.addEventListener 'click', =>
      for breakpoint in breakpoints
        @runCmd(cmd, breakpoint)
    # message.classList.add('message')
    @element.appendChild(message)

