fix NRE
refactor config saving code