bugfixes, encapsulated db_connect behavior
etup_db