Modified the stop method to queue the service for being stopped.