update save to file method