fix cloning recursion issue