fixed bug where recursive copy wasn't setting up the references to parent