Fixed ids issue when cloning