             
             case ACI_DEVICE_STANDBY:
               Serial.println(F("Evt Device Started: Standby"));
-              {            
+              if (aci_evt->params.device_started.hw_error)
+              {
+                delay(20); //Magic number used to make sure the HW error event is handled correctly.
+              }
+              else
+              { 
                 //Manage the bond in EEPROM of the AVR
                 {
                   uint8_t eeprom_status = 0;

          //all other ACI commands will have status code of ACI_STATUS_SCUCCESS for a successful command
          Serial.print(F("ACI Command "));
          Serial.println(aci_evt->params.cmd_rsp.cmd_opcode, HEX);
          Serial.println(F("Evt Cmd respone: Error. Arduino is in an while(1); loop"));
          while (1);
        }
        if (ACI_CMD_GET_DEVICE_VERSION == aci_evt->params.cmd_rsp.cmd_opcode)
        {

                    }                  
                  }                
                }
           
                // Start bonding as all proximity devices need to be bonded to be usable
                if (ACI_BOND_STATUS_SUCCESS != aci_state.bonded)
                {
