wait for reduce process to finish before exiting