         @emit 'entry', {job, order:(++@children)}
 
     release: () =>
-        @emit 'release', {order:0} unless @released
+        return if @released
+        @emit 'open scope', {order:0}
         @released = yes
 
 


    onattr: (el, key, value) ->
        return unless el.isempty
        console.warn "attributes of #{el.toString()} don't change anymore"

    onend: () ->
        if @closed? and @opened_tags is 0
            @close()
        else
            @builder.closed = 'pending'
            @closed = @close




            @release() if @children
            @isnext = yes
        # get the order position of this entry
        idx = @parent?._stream.children ? -1
        # placeholder for close
        @parent?._stream.children++
        # when this entry is ready resume parent
        el.ready ->
            @parent?._stream.emit('close scope', order:idx+1)
        @parent?._stream.release()

    emit: ->
        @order.emit(arguments...)
