 
   # Run pending actions
   _clearPending: ->
-    for [fn, that, args], i in @pending by - 1
+    for [fn, that, args] in @pending by - 1
       fn.apply(that, args)
       @pending.length--
 
   # If connection is not ready, then we will wait until it is
   defer: (self, fn, args...) ->
     if @state is ONLINE
-      fn(args...)
+      fn.apply(self, args)
     else
       @pending.push [fn, self,  args]
-      console.log @pending
 
   state: OFFLINE
 


  extended: ->

    @fetch Sync.defer(this, @loadLocal)
    @change Sync.defer(this, @saveLocal)

    Sync.connect()



  loadLocal: (options = {}) ->

    console.log '%c> Fetching notes', 'color: blue'

    options.clear = true unless options.hasOwnProperty('clear')

