added missing function_exists() check