add the read and write file func