Move save into datafile and set file mode