corrected search flow