writeconfig writes the builtin config;add setconfig
when wrting the active profile, check one is set