added some error handling to search requests