fixed bug in train.py