checking for NaNs