Adding loop for checking for barcode