How about after the foreach loop so multiple files remain grouped.