diff --git a/internal/pkg/application/application.go b/internal/pkg/application/application.go
index 730be6c..73a88a9 100644
--- a/internal/pkg/application/application.go
+++ b/internal/pkg/application/application.go
@@ -237,7 +237,7 @@
 	d.GlobalDhcpFlowAdded = false
 	if config, ok := GetApplication().DevicesConfig.Load(slno); ok {
 		//Update nni dhcp vid
-		deviceConfig := config.(DeviceConfig)
+		deviceConfig := config.(*DeviceConfig)
 		d.NniDhcpTrapVid = of.VlanType(deviceConfig.NniDhcpTrapVid)
 	}
 	return &d
@@ -455,7 +455,7 @@
 	SerialNumber       string `json:"id"`
 	HardwareIdentifier string `json:"hardwareIdentifier"`
 	IPAddress          string `json:"ipAddress"`
-	UplinkPort         int    `json:"uplinkPort"`
+	UplinkPort         string `json:"uplinkPort"`
 	NasID              string `json:"nasId"`
 	NniDhcpTrapVid     int    `json:"nniDhcpTrapVid"`
 }
@@ -573,7 +573,7 @@
 	return nil
 }
 
-func (va *VoltApplication) AddDeviceConfig(cntx context.Context, serialNum, hardwareIdentifier, nasID, ipAddress string, uplinkPort, nniDhcpTrapId int) error {
+func (va *VoltApplication) AddDeviceConfig(cntx context.Context, serialNum, hardwareIdentifier, nasID, ipAddress, uplinkPort string, nniDhcpTrapId int) error {
 	var dc *DeviceConfig
 
 	deviceConfig := &DeviceConfig{
@@ -832,7 +832,7 @@
 // protection mechanism (LAG, ERPS, etc.). The aggregate of the such protection
 // is represented by a single NNI port
 func (va *VoltApplication) AddDevice(cntx context.Context, device string, slno, southBoundID string) {
-	logger.Warnw(ctx, "Received Device Ind: Add", log.Fields{"Device": device, "SrNo": slno})
+	logger.Warnw(ctx, "Received Device Ind: Add", log.Fields{"Device": device, "SrNo": slno, "southBoundID": southBoundID})
 	if _, ok := va.DevicesDisc.Load(device); ok {
 		logger.Warnw(ctx, "Device Exists", log.Fields{"Device": device})
 	}
diff --git a/internal/pkg/application/vnets.go b/internal/pkg/application/vnets.go
index a95104c..548879f 100644
--- a/internal/pkg/application/vnets.go
+++ b/internal/pkg/application/vnets.go
@@ -510,16 +510,6 @@
 	vpv.IgmpEnabled = false
 	vpv.MacAddr, _ = net.ParseMAC("00:00:00:00:00:00")
 	vpv.LearntMacAddr, _ = net.ParseMAC("00:00:00:00:00:00")
-	// for OLTCVLAN SVLAN=CVLAN, UNIVLAN can differ.
-	/*
-	if vpv.VlanControl == ONUCVlan {
-		vpv.CVlan = vpv.SVlan
-	}
-	// for OLTSVLAN  CVLAN=UNIVLAN , SVLAN can differ,
-	// hence assigning UNIVLAN to CVLAN, so that ONU will transparently forward the packet.
-	if vpv.VlanControl == OLTSVlan {
-		vpv.CVlan = vpv.UniVlan
-	}*/
 	vpv.servicesCount = atomic.NewUint64(0)
 	vpv.SchedID = 0
 	vpv.PendingDeleteFlow = make(map[string]bool)
@@ -781,20 +771,13 @@
 		//If NNI port is not mached to nb nni port dont send flows
 		devConfig := GetApplication().GetDeviceConfig(device.SerialNum)
 		if devConfig != nil {
-			if devConfig.UplinkPort != int(nniPort.ID) {
-				logger.Errorw(ctx, "NNI port not configured from NB, not pushing flows", log.Fields{"NNI Port": devConfig.UplinkPort, "NB NNI port": nniPort.ID})
+			if devConfig.UplinkPort != strconv.Itoa(int(nniPort.ID)) {
+				logger.Errorw(ctx, "NNI port not configured from NB, not pushing flows", log.Fields{"NB NNI Port": devConfig.UplinkPort, "SB NNI port": nniPort.ID})
 				return
 			}
 		}
 	}
 
-	if vp := device.GetPort(port); vp != nil {
-		if vpv.PonPort != 0xFF && vpv.PonPort != vp.PonPort {
-			logger.Errorw(ctx, "UNI port discovered on wrong PON Port. Dropping Flow Config for VPV", log.Fields{"Device": device.Name, "Port": port, "DetectedPon": vp.PonPort, "ExpectedPon": vpv.PonPort, "Vnet": vpv.VnetName})
-			return
-		}
-	}
-
 	if vpv.Blocked {
 		logger.Errorw(ctx, "VPV Bocked for Processing. Ignoring flow push request", log.Fields{"Port": vpv.Port, "Vnet": vpv.VnetName})
 		return
@@ -815,13 +798,13 @@
 		if vpv.MacLearning == MacLearningNone || NonZeroMacAddress(vpv.MacAddr) {
 			logger.Infow(ctx, "Port Up - DS Flows", log.Fields{"Device": device.Name, "Port": port})
 			/*In case of DPU_MGMT_TRAFFIC, need to install both US and DS traffic */
-			if  vpv.VnetType == DPU_MGMT_TRAFFIC {
+			if vpv.VnetType == DPU_MGMT_TRAFFIC {
 				vpv.RangeOnServices(cntx, AddUsHsiaFlows)
 			}
 			// US & DS DHCP, US HSIA flows are already installed
 			// install only DS HSIA flow here.
 			// no HSIA flows for multicast service
-			if !vpv.McastService  {
+			if !vpv.McastService {
 				vpv.RangeOnServices(cntx, AddDsHsiaFlows)
 			}
 		}
@@ -1051,17 +1034,6 @@
 	logger.Debugw(ctx, "Added MAC to VPV", log.Fields{"MacLearning": vpv.MacLearning, "VPV": vpv})
 	//Reconfigure Vlans based on Vlan Control type
 	svc.VlanControl = vpv.VlanControl
-	//TODO Is it good to change NB config?? commenting for now
-	/*
-	// for OLTCVLAN SVLAN=CVLAN, UNIVLAN can differ.
-	if vpv.VlanControl == ONUCVlan {
-		svc.CVlan = svc.SVlan
-	}
-	// for OLTSVLAN  CVLAN=UNIVLAN , SVLAN can differ,
-	// hence assigning UNIVLAN to CVLAN, so that ONU will transparently forward the packet.
-	if vpv.VlanControl == OLTSVlan {
-		svc.CVlan = svc.UniVlan
-	}*/
 	if svc.McastService {
 		vpv.McastService = true
 		vpv.McastTechProfileID = svc.TechProfileID
@@ -1099,8 +1071,8 @@
 	//If NNI port is not mached to nb nni port
 	devConfig := GetApplication().GetDeviceConfig(voltDevice.SerialNum)
 
-	if strconv.Itoa(devConfig.UplinkPort) != voltDevice.NniPort {
-		logger.Errorw(ctx, "NNI port mismatch", log.Fields{"NNI Port": devConfig.UplinkPort, "NB NNI port": voltDevice.NniPort})
+	if devConfig.UplinkPort != voltDevice.NniPort {
+		logger.Errorw(ctx, "NNI port mismatch", log.Fields{"NB NNI Port": devConfig.UplinkPort, "SB NNI port": voltDevice.NniPort})
 		return
 	}
 	//Push Service Flows if DHCP relay is not configured
@@ -1234,7 +1206,7 @@
 // AddMeterToDevice to add meter config to device, used in FTTB case
 func AddMeterToDevice(cntx context.Context, key, value interface{}) bool {
 	svc := value.(*VoltService)
-	if err:= svc.AddMeterToDevice(cntx); err != nil {
+	if err := svc.AddMeterToDevice(cntx); err != nil {
 		logger.Warnw(ctx, "Add Meter failed", log.Fields{"service": svc.Name, "Error": err})
 	}
 	return true
@@ -1706,7 +1678,6 @@
 	subFlow := of.NewVoltSubFlow()
 	subFlow.SetTableID(0)
 
-
 	if vpv.VnetType == DPU_MGMT_TRAFFIC {
 		subFlow.SetMatchVlan(vpv.CVlan)
 		subFlow.SetMatchPbit(vpv.UsPonCTagPriority)
