fixing error where subnodes keep getting recreated