         @builder = this
         @buffer = [] # for child output
         @pending = [] # no open child tag
-        @checkers = [] # all the middlewares that have to approve a new tag
+        @checkers = {} # all the middlewares that have to approve a new tag
         # states
         @closed = no
         # defaults

        else if type is 'text'
            tag.content

    use: (checker) ->
        @checkers.push checker

    approve: (parent, tag, callback) ->
        checkers = @checkers.slice()
        next = (tag) ->
            checker = checkers.shift() ? callback
            checker parent, tag, next
        next(tag)

# exports

            if @pending.length
                @closed = 'pending'
            else
                @builder.approve 'end', this, =>
                    if @isempty
                        data = "<#{@name}#{new_attrs @attrs}/>"
                        @closed = 'self'
                    else
                        data = "</#{@name}>"
                        @closed = yes
                    @emit 'data', prettify this, data
                    @emit 'close', this
                    @emit 'end'
                    @writable = false
        else if @closed is 'removed'
            @builder.approve 'end', this, =>
                @emit 'end'
                @writable = false
        else
            @closed = yes
            @writable = false
        this

    toString: () =>
