added restart logic