qrcode logic