repaired rpc function for qrcode