copy value before making accumlator for unpack foreach