   startSocketIOServer: ->
     return unless @server?
 
-    io = socketIo @server
+    @io = socketIo @server
 
-    io.on 'connection', (socket) =>
+    @io.on 'connection', (socket) =>
       @ioSocket = socket
       @updateContent()
 

  editor: null
  server: null
  sockets: []
  ioSocket: null

  start: ->

      console.error 'Broadcast has not started'
      return

    @stopSocketIOServer()
    @stopServer()

  stopServer: ->
    if @sockets.length > 0
      for socket in @sockets
        socket.destroy()
