add nan handling code sample