Updated barcode scanner code