fix file deletion issue