wait when stopping processes