     @opts.builder = circular['default']
     opts.builder = circular['input'] or @opts.builder
 
-    @pending.push tag = new (builder.Tag) name, attrs, null, opts
+    @pending.push tag = new opts.builder.Tag name, attrs, null, opts
 
     tag.up = (opts = {}) => # set parent
         opts.end ?= true

{ deep_merge, indent, new_attrs, safe } = require './util'
EVENTS = ['add', 'attr', 'attr:remove', 'text', 'remove', 'close']

new_tag = (builder, name, attrs, children, opts) ->
    unless typeof attrs is 'object'
        [opts, children, attrs] = [children, attrs, {}]
    else

            @end()
        @_new_tag parent, name, attrs, self_ending_children_scope, opts

    tag: =>
        @level--
        tag = @_new_tag this, arguments...
        @level++
        tag

    $tag: =>
        @level--
        tag = @_new_sync_tag this, arguments...
        @level++
        tag

