Added check for win