Fixed an SQL which was selecting only those categories who have root
property.