updated to include avro record with possible null value