fix logic for 'category' field