fix error on search functionality