added game state check to flip