Hi trying to use LS with IG api and having trouble getting a subscription set up.

Keep getting following error:

Error encountered !
Status code: unknown
Error code: ReferenceError: subscription is not defined


Can get data from API call no problem.
Can connect to LS no problem.
But setting up the subscription is proving very problematic.
I've added the function code below if anyone can help much appreciated:
// Now subscribe to the BID and OFFER prices
var fieldList = ["bid","offer","updateTime","delayTime","marketStat us"];
require(["Subscription"], function (Subscription) {
// Set up Lightstreamer FIDs
var subscription = new Subscription("MERGE","L1:IX.D.DAX.IFD.IP",fieldLis t)
});

// Set up Lightstreamer event listener
subscription.addListener({
onSubscription: function () {
console.log('subscribed');
},
onSubscriptionError: function (code, message) {
console.log('subscription failure: ' + code + " message: " + message);
},
onItemUpdate: function (updateInfo) {

// Lightstreamer published some data
// Add a new row to data table
var marketStatus=getValue(marketStatus);
var bidprc=getValue(bid);
var offprc=getValue(offer);
var delayTm=getValue(delayTime);
var updTm=getValue(updateTime);
var chg = "";

$('#search_results_list').find('tbody:last').appen d(''+marketStatus+''+updTm+''+delayTm+''+bidprc+'' +offprc+''+chg+'');
}

});
// Subscribe to Lightstreamer
lsClient.subscribe(subscription);