fixed a bug in selecting the winner