search query exception handling