fixed config writing bug