dealing with NaNs