fixed missing function for ifs