fixed bug in util.py