fix missing fetch_pkgs function