added write data to file