fix ifs which switches on boolean vars