fix issues with config reading and saving