Added win/lose condidion check