added check if package is installed before running background task