 
     events[key]
 
+  buildKey = (key) ->
+    "topic:" + key
+
   app.redis.pubsub.subscribe('newData')
 
   app.redis.pubsub.on 'message', (topic, value) ->
     if topic != 'newData'
+      topic = topic.split(":")[1..-1].join("")
       data = new Data(topic, value)
       getEventEmitter(topic).emit('change', data)
     else

    setValue: (val) -> @value = val

    on: (event, callback) ->
      app.redis.pubsub.subscribe(@key)
      getEventEmitter(@key).on(event, callback)
      @


      callback = args.shift()

    # FIXME this is not atomic, is it a problem?
    app.redis.client.get buildKey(key), (err, oldValue) ->
      data = new Data(key, oldValue)
      if value?
        data.setValue(value)
