added rectified code for search