Added support for stopAndWait