fixed ifs issues