add check win function