fix bug in config saving