added IsPaperInSubcategories function.