restart game function almost works, but the restarted game never ends...