insert array reinitialized inside for each