fixed bugs with win variables.