fixed up nesting of dom elements