Replace the old foreach trick with the new addmagazines

Need to be checked. never trust machines :computer: