fixed bug in clone()