Changed so parents process waits for child process to exit

Untested