fixed search_result logic