fix the isDirectory test in handleFileDelete