changed config file creation logic a bit