change array with template,  change object clone function