Update createChild function