fix logging, config file content was old
process writing of config file if it's not written
-- (reformat code)