 
     socket.on 'connect_error', (obj) => console.log 'connect error', obj
     socket.on 'disconnect',          => console.log "socket at #{@_url()} disconnected"
-    socket.on 'colorChanged',           @_to_buffer
-    socket.on 'colorSet',               @_to_buffer
+    socket.on 'colorChanged', (data) =>
+      @_to_buffer(data)
+
+    socket.on 'colorSet', (data) =>
+      @_to_buffer(data)
 
   #
   # connect to /dev/ttyO1, on success fire a call to _setup_sio()


    # padding with black if necessary
    instruction_count = (instruction.match(/;/g)||[]).length
    instruction += "4,#{i+1},000,000,000,000;" for i in [instruction_count...5]
    return instruction

  #

  #   # => '4,1,000,110,255,000;'
  #
  _data_to_instruction: (data) ->
    console.log "called _data_to_instruction"
    # break colors string into array
    colors = data.color.split '\n'
    colors.pop()
