fix a crash in the server
create directories and empty files when cloning