wait for any process to be killed implemented