Avoid infinite loop and add updateGameLog function