make it so that the game does not crash when the ai finishes first