Added checks and alert dialog for winning.