Fix error when delete and rename files