train model method added