Cannot read property 'category' of undefined