         }
 
         if virtualOutputs != [0] {
-            endpointsRef.forEach {MIDIReceived($0, packetListPointer)}
+            virtualOutputPorts?.forEach {MIDIReceived($0, packetListPointer)}
         }
     }
 }

    /// - Parameters:
    ///   - data: Array of MIDI Bytes
    ///   - offset: Timestamp offset
    public func sendMessage(_ data: [MIDIByte], offset: MIDITimeStamp = 0, endpointsUIDs: [MIDIUniqueID]? = nil) {

        // Create a buffer that is big enough to hold the data to be sent and
        // all the necessary headers.

                }

                if virtualOutputs != [0] {
                    virtualOutputPorts?.forEach {MIDIReceived($0, packetListPointer)}
                }
            }
        }
