fix db_iteration