Corrected error in search results function