changed isnan to np.isnana