Improved waiting for isRunning state