trim the barcode before checking if it is empty or not.