Fixing addFile method