diff --git a/voltha/adapters/openolt/openolt_device.py b/voltha/adapters/openolt/openolt_device.py
index 8dfa42b..dea361e 100644
--- a/voltha/adapters/openolt/openolt_device.py
+++ b/voltha/adapters/openolt/openolt_device.py
@@ -320,30 +320,27 @@
                 self.log.warn('unexpected state', onu_id=onu_id, onu_device_oper_state=onu_device.oper_status)
 
     def onu_indication(self, onu_indication):
-        self.log.debug("onu-indication", intf_id=onu_indication.intf_id,
-                onu_id=onu_indication.onu_id, serial_number=onu_indication.serial_number,
-                    oper_state=onu_indication.oper_state, admin_state=onu_indication.admin_state)
+        self.log.debug("onu indication", intf_id=onu_indication.intf_id,
+                onu_id=onu_indication.onu_id,
+                serial_number=onu_indication.serial_number,
+                oper_state=onu_indication.oper_state,
+                admin_state=onu_indication.admin_state)
 
-        serial_number_str = self.stringify_serial_number(onu_indication.serial_number)
-
-        if serial_number_str == '000000000000':
-            self.log.debug('serial-number-was-not-provided-or-default-serial-number-provided-identifying-onu-by-onu_id')
-            #FIXME: if multiple PON ports onu_id is not a sufficient key
+        if onu_indication.serial_number:
             onu_device = self.adapter_agent.get_child_device(
-                self.device_id,
-                onu_id=onu_indication.onu_id)
+                    self.device_id,
+                    serial_number=self.stringify_serial_number(
+                            onu_indication.serial_number))
         else :
             onu_device = self.adapter_agent.get_child_device(
-                self.device_id,
-                serial_number=serial_number_str)
+                    self.device_id,
+                    parent_port_no=platform.intf_id_to_port_no(
+                            onu_indication.intf_id, Port.PON_OLT),
+                    onu_id=onu_indication.onu_id)
 
-        self.log.debug('onu-device', olt_device_id=self.device_id, device=onu_device)
-
-        # FIXME - handle serial_number mismatch
-        # assert key is not None
-        # assert onu_device is not None
         if onu_device is None:
-            self.log.warn('onu-device-is-none-invalid-message')
+            self.log.error('onu not found', intf_id=onu_indication.intf_id,
+                    onu_id=onu_indication.onu_id)
             return
 
         if onu_device.connect_status != ConnectStatus.REACHABLE:
@@ -363,7 +360,7 @@
                           received_onu_id=onu_indication.onu_id)
 
         uni_no = platform.mk_uni_port_num(onu_indication.intf_id, onu_indication.onu_id)
-        uni_name = self.port_name(uni_no, Port.ETHERNET_UNI, serial_number=serial_number_str)
+        uni_name = self.port_name(uni_no, Port.ETHERNET_UNI, serial_number=onu_device.serial_number)
 
         self.log.debug('port-number-ready', uni_no=uni_no, uni_name=uni_name)
 
@@ -839,4 +836,4 @@
 
         # Set all ports to enabled
         self.log.info('enabling-all-ports', device_id=self.device_id)
-        self.adapter_agent.enable_all_ports(self.device_id)
\ No newline at end of file
+        self.adapter_agent.enable_all_ports(self.device_id)
