func: fix save to file