fix end_game method