isWin not workong right, don't know why