fix random barcode to work with new data structures