Fixed an bug in the win condition