writing data file