Fix bugs when delete file