fix bug in bsmf.py, tested in latancy folder