Added database config writing