trying to fix the bug with undefined category