Added if(dir.exists()) to CleanUpTempDir