add ensureStarted() and ensureStopped() methods