use local variable instead of method arg
change exception handler to .isdigit