fixed some bugs when category is not available