Update utils.py

If the input string was given as an integer, the conversion failed. 
There might be better solutions to the problem than the one I propose, this is mostly to raise awareness of the issue.