fixed the win and lose bug