adding solution for dom hierarchy problem