Fix delete file error (file may not be removed)