fix get category function