move check for zero-length string to isnumeric()