error handling for barcode reader