disallow nan in JSON serialization

since it's not actually valid JSON