catch the right exception - fix the search
encode search query as well