fixed bug when cloning