Fixed an issue with ifs