Handling qr scan