Change way to write config file