check for package existence first