added check on addTo method for valid parent data