added isNaN to the mix