modify the clone function