fix a bug in ml.py