Fix bug when snapshot current dir.