fix saving bug