minor mod to addchild method