fix bugs in re-ordering and prediction