Added back the checking if game is finished.