   _commit: (callback) ->
     return callback null if @aggregates.length is 0
 
-    committedEvents = []
+    events      = [];
+    savedEvents = [];
 
     aggregateQueue = async.queue (aggregate, aggregateTaskCallback) =>
       firstEvent = aggregate.appliedEvents.shift()

          queue.push nextEvent if nextEvent?

          @logger.log "commit", "saving event \"#{event.name}\" for aggregate #{event.aggregateUid}"
          @store.saveEvent event, (err, event) =>
            if err?
              eventTaskCallback err
            else
              committedEvents.push event
              eventTaskCallback null
        , 1



    aggregateQueue.drain = (err) =>
      return callback err if err?
      return callback null unless events.length > 0
      publicationQueue = async.queue (event, publicationCallback) =>
        @_publishEvent event, publicationCallback
      , Infinity
      publicationQueue.drain = callback
      publicationQueue.push events

    aggregateQueue.push @aggregates
    @aggregates = []
