fix restart behavior in service.cs