Fix a bug of removing file