better null handling for extractNumber