Updated for Dynamic switching of Categories