added small function to collect categories for a controller