Fixed to avoid crashing when the service has been re-installed.