Updating dom nodes; rendering DOMElement incorrect