public function aroundReindex(\Magento\Catalog\Model\Category $category, \Closure $proceed)
    {
        $proceed();

        // Reindex only if attached product list has changed.
        // This prevent reindexing if the category is just created and set to virtual.
        if ($category->dataHasChangedFor('is_virtual_category') && ($category->getIsChangedProductList() === true)) {
            if (((bool) $category->getIsVirtualCategory() === true) && ($category->getId())) {
                if (!$this->getIndexer()->isScheduled()) {
                    // Remove default root category (1) and Store Root.
                    $this->getIndexer()->reindexList(array_slice($category->getPathIds(), 2));
                }
            }
        }
    }