fix queue to train ordering