TypeError: Cannot read property 'category' of undefined