applied changes for object_copy function