Fixed error "Undefined variable: categories"