fixed config file writing