fix call to isStartingURL()

previously, isStartingURL(true) was called on every iteration (if $i > 0 evaluates as true for all but the first iteration, where $url would equal $starting_url), fixed to only call on the first iteration or when $url == $starting_url