function to test if a package is installed