fix saving settings bug