def refresh_table(self):
        current_time = time.time()
        self.table_widget.setRowCount(0)
        
        filtered_offline = {
            hostname: details for hostname, details in self.offline_dict.items()
            if (current_time - details['start_time']) > OFFLINE_DURATION
        }

        if self.inspect_filter_state == 1:
            filtered_offline = {hostname: details for hostname, details in filtered_offline.items() if details.get('inspect_status') in ['WAN down', 'Server up']}
        elif self.inspect_filter_state == 2:
            filtered_offline = {hostname: details for hostname, details in filtered_offline.items() if details.get('inspect_status') in ['Server down', 'Server up']}

        sorted_offline = sorted(filtered_offline.items(), key=lambda item: current_time - item[1]['start_time'], reverse=True)

        if self.settings_widget:
            exception_hosts = self.settings_widget.exception_hosts

        for row, (hostname, details) in enumerate(sorted_offline):
            duration_seconds = int(current_time - details['start_time'])
            hours, remainder = divmod(duration_seconds, 3600)
            minutes, seconds = divmod(remainder, 60)
            duration = f"{hours:02}:{minutes:02}:{seconds:02}"
            comment = details.get('comment', '')
            if hostname in self.offline_dict:
                inspect_status = details.get('inspect_status', 'Unknown')
            else:
                inspect_status = 'Online'
            if duration_seconds > ALERT_TIME and current_time - details['last_alert_time'] > ALERT_REPEAT:
                if self.settings_widget: #and (self.settings_widget.pop_up_alert_enabled or self.settings_widget.sound_alert_enabled):
                    normalized_hostname = hostname.upper()
                    exception_hosts_upper = {h.upper() for h in self.settings_widget.exception_hosts}
                    if normalized_hostname not in exception_hosts_upper:
                        if self.settings_widget.pop_up_alert_enabled:
                            threading.Thread(target=self.trigger_pop_up_alert, args=(hostname, details, duration), daemon=True).start()
                        if self.settings_widget.sound_alert_enabled:
                            threading.Thread(target=self.trigger_sound_alert, args=(hostname, details, duration), daemon=True).start()
                details['last_alert_time'] = current_time
            self.table_widget.insertRow(row)
            item_no = QTableWidgetItem(str(row + 1))
            item_hostname = QTableWidgetItem(hostname)
            item_store_name = QTableWidgetItem(details['store_name'])
            item_telephone = QTableWidgetItem(details['telephone'])
            item_offline_time = QTableWidgetItem(details['offline_time'])
            item_duration = QTableWidgetItem(duration)
            item_inspect = QTableWidgetItem(inspect_status)
            item_comment = QTableWidgetItem(comment)
            item_hostname.setTextAlignment(Qt.AlignCenter)
            item_offline_time.setTextAlignment(Qt.AlignCenter)
            item_duration.setTextAlignment(Qt.AlignCenter)
            item_inspect.setTextAlignment(Qt.AlignCenter)
            self.table_widget.setItem(row, 0, item_no)
            self.table_widget.setItem(row, 1, item_hostname)
            self.table_widget.setItem(row, 2, item_store_name)
            self.table_widget.setItem(row, 3, item_telephone)
            self.table_widget.setItem(row, 4, item_offline_time)
            self.table_widget.setItem(row, 5, item_duration)
            self.table_widget.setItem(row, 6, item_inspect)
            self.table_widget.setItem(row, 7, item_comment)
            if hostname.startswith(("PTH11","PTH15")):
                self.set_row_color(row, QColor('lightyellow'))
            if inspect_status == "Server up":
                self.set_row_color(row, QColor('palegreen'))
            if hostname in self.offline_dict and current_time - details['start_time'] > OFFLINE_DURATION:
                details['comment'] = self.table_widget.item(row, 7).text()
            else:
                if hostname in self.offline_dict:
                    del self.offline_dict[hostname]
        self.adjust_row_heights()

make faster update to remove hostname online from list