Added WaitForState to poll for running state