Why the file mode updates here?