var():fixed ifs issue