foreach edge test corrected