altered plugin to work with updated subcategory plugin