added db_connect functionality