fixed bug when there is a inner tag with same name as root tag