handle service's stop correctly