fixed the var bug