added logging
write config