     catch error
       console.log error.message
       console.log "Error while storing #{JSON.stringify(value)} in store #{storeName}"
-      callback {}
+      if callback?
+        callback {}
     return
     
   get : (query, callback) ->

  store : (storeName, value, callback)->
    try
      if value._children?
        count = value._children.length
        for child in value._children
          do(child) =>
            @store child.objectStore value[child.name], () ->
              delete value[child.name]
              if count == 1
                delete value._children
                trans = @db.transaction [storeName], "readwrite"
                store = trans.objectStore storeName
                request = store.put value
                request.onsuccess = (event) ->
                  if callback?
                    try
                      callback event.target.result
                    catch error
                  return
                
                request.onerror = @onerror
              else
                count--
              return
            return
      else
        trans = @db.transaction [storeName], "readwrite"

                for child in query.children
                  do(child) =>
                    @get new mem0r1es.Query().from(child.objectStore).where("_#{store.keyPath}", "equals", result[store.keyPath]), (subResults) =>
                        result[child.name] = subResults
                      if count is 1
                        callback results
                      else
