Fixed bug where the service would continue when it should not