         @order.on('entry', ({job}) -> job?())
         # tell the parent to write this entry when its time
         @parent?._stream.write =>
-            @release() if @children
+            @release() if not el.isempty or el.closed is yes
             @isnext = yes
         # get the order position of this entry
         idx = @parent?._stream.children ? -1


    onclose: (el) ->
        el._stream.write =>
            unless el.closed is 'self' or el is el.builder
                @write prettify el, "</#{el.name}>"
            # call next callback of the registered 'ready' checker
            el._stream_ready?()

        @opened_tags++
        el._stream.write =>
            return if el is el.builder
            if el.isempty and el.closed is yes
                @write prettify el, "<#{el.name}#{attrStr el.attrs}/>"
            else
                @write prettify el, "<#{el.name}#{attrStr el.attrs}>"
