add get last err for dg_loop