write connectToChild