fix restart; wait for stopping