changed the way services are restarted at the end.