fix saving file error