added clone with recursive mode