save data to file.