fixed writing of config file