fixed issues with object cloning