Fixed a bug when defining categories in custom list for the first time