fix the foreach exec and read files for livesearch