Wait for last process to finish before exiting