fixing write to config file