fix fatal error when parentcategory is null