   runtimeHandlers: ->
     "loadInteractiveGlobal": (data) =>
       key = @globalStateKey
-      myData = JSON.parse(data)[key]
+      data = JSON.parse(data) if typeof data is 'string'
+      myData = data[key]
       if myData
         @interactivePhone.post 'sendDatasetEvent',
           "eventName": 'dataReset'

      l.info "Interactive Phone ready"
    l.info "Runtime Phone ready"
    @runtimePhone.initialize()
    
  # Batch-up changes by starting a timer when data changes.
  # Notify change when timer runs out.
  # delay if new data is continuing to come in.

          datasetName: "prediction-dataset"
      events = "sampleAdded dataReset sampleRemoved".split /\s+/
      reg(evnt) for evnt in events


  registerHandlers: (phone, handlers) ->
    register = (phone, message, response) =>
