fixed a bug in helper.py