stop service conditionally