Use a "while" loop to wait for process to die