Copying objects in setter and getter methods