Error handling in Search corrected