The problem with that condition is you have 2 expressions in parenthesis. Thus, if the destination number is from 1000 to 1019, it will set $1 to the number. However, if the destination number is 12345, then it will set $2 to that number, and leave $1 unset.