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

            el._stream_ready?()
            el._stream_ready = yes


    ondata: (el, data) ->
        el._stream.write =>
            @write data


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

    onend: () ->
        return @close() if @closed? or @opened_tags is 0
        # delay until last tag gets closed and written out
        @builder.closed = 'pending'
        @closed = @close



