fix nil search error, refine search results