Added restart logic