make the cloning process more robust

Signed-off-by: Sébastien Boisvert <boisvert@anl.gov>