Fixed the deleteFile method