Fix infinite loop in server after game is lost