check if the package directory exists before trying to delete it