updated to make the service shutdown