fixed bug in utils.py