fix broken session-setup (_db_version attribute defined after first use)