some changes into the removeFile method