add test for search with error