finalized parent function waiting for childs