Added edge case handling for search results