     for stackTemplateId in stackTemplates
       existentStacks = @storage.stacks.query 'baseStackId', stackTemplateId
       existents += existentStacks.length
+
+    debug 'checkGroupStackRevisions existents', existents, stackTemplates.length
 
     if existents isnt stackTemplates.length
     then @emit 'GroupStacksInconsistent'


  checkStackRevisions: (stackTemplateId) ->

    # fetch all the stacks in cache
    (@storage.stacks.get()).forEach (stack) =>

      # if a specific stackTemplateId provided then skip all others
      # otherwise check all of them one by one


      @on 'StackAdminMessageDeleted', @bound 'handleStackAdminMessageDeleted'

      groupsController.on 'StackTemplateChanged', (event) => @checkGroupStacks event?.contents
      groupsController.on 'StackAdminMessageCreated', @bound 'handleStackAdminMessageCreated'
      groupsController.on 'SharedStackTemplateAccessLevel', @bound 'sharedStackTemplateAccessLevel'

