adding code for creating child docs and updating parent docs during child creation