for loop change

Added the for loop to insert a flag for target in found text