add non nil check for category name, add some functions to fix category