add deep cloning to documents