possible fix for endgame bug