copy an object's properties to another one