fixes error on returning category and searching by category