Added logic to deal with unknown barcodes