replace invalid exception with NaN values all over