wait for child processed before exit()

tags: relevant