dwell code error check and batchin reorder