recursively copy the properties of an object to another