make open_internal_db function