added method for canging game state