fixed sub_categories method undefined error