move isNaN() to root scope