fix number/nan detection