Implement duplicateObject functionality