Changed foreach loop to a for loop so break statement would work.