add failsafe ifs