fix write_config