minor fix in getting the categories from the database