Adds input validation and ensures that nothing happens after the game is finished.