fix saving file