ugly method to connect barcode encode