changed service.isRestarting to a invoke function scope