handle BadRequestException while calling search