added flag option to search_res