Need to do something different here. If you set barcode info to [] then in the next line reference barcodeinfo[6] it will die.