Fixing to unregister service when complete