implementing sub categories functionality