some modifs on train function