 
     TagInstance = @builder?.Tag ? Tag
     newtag = new TagInstance name, attrs, null, opts
-    newtag.parent = this
     add_tag.call this, newtag, (tag) ->
         tag.children children, opts if children?
     return newtag # hopefully this is still the same after the approval

            if (listener = listeners[event])?
                child.removeListener?(event, listener)
                listeners[event] = undefined
    remove = ->
        dispose()
        if this is child
            parent.removeListener('removed', remove)
        else
            child.removeListener('removed', remove)
        parent.removeListener('replaced', replace)
        child.removeListener('replaced', replace)
    replace = (tag) ->
        if this is child
            remove.call(parent)

        tag.emit? 'close', tag if tag.closed
        callback?.call(this, tag)

    newtag.parent = this
    if @builder?
        @builder.approve('new', this, newtag, wire_tag)
    else
