automatic writing of config file