Update utils.py

Fixed -2250
Fixed #2250
Made more better
Merge pull request #2271 from mikecool1000/fix-2250

Fixed #2250