fixed win condition logic