     return cb("key required") unless k
     d = @getValue(path)
     d.value = data
-    @client.hset(VALUES_KEY, k, @data.vals[k], cb)
+    @client.hset(VALUES_KEY, k, JSON.stringify(@data.vals[k]), cb)
 
 
   getKeys: (path) ->

      @loadValues(data)
      @client.hgetall LINKS_KEY, (err, data) =>
        @loadLinks(data)
        @ready = true

  loadValues: (data) ->
    return unless data
    l = data.length
    i = 0
    while i < l-2
      @data.vals[data[i]] = JSON.parse(data[i+1])
      i+=2

  loadLinks: (data) ->
    return unless data
    l = data.length
    i = 0
    while i < l-2
      @data.links[data[i]] = data[i+1]
      i+=2

    for l, s of @data.links
      @linkValue(l, s)




  setLink: (path, source, cb) ->
    @linkValue(path, source)
    try
      JSON.stringify(@getValue(path))
