remove duplicate loop at train()