moved config file write