diff --git a/app.go b/app.go
index f58cccc..fcf287f 100644
--- a/app.go
+++ b/app.go
@@ -135,6 +135,7 @@ func (h *Headscale) expireEphemeralNodesWorker() {
 				if err != nil {
 					log.Error().Err(err).Str("machine", m.Name).Msg("🤮 Cannot delete ephemeral machine from the database")
 				}
+				h.notifyChangesToPeers(&m)
 			}
 		}
 	}
diff --git a/machine.go b/machine.go
index 4c7e594..81208a8 100644
--- a/machine.go
+++ b/machine.go
@@ -238,3 +238,26 @@ func (m *Machine) GetHostInfo() (*tailcfg.Hostinfo, error) {
 	}
 	return &hostinfo, nil
 }
+
+func (h *Headscale) notifyChangesToPeers(m *Machine) error {
+	peers, _ := h.getPeers(*m)
+	for _, p := range *peers {
+		pUp, ok := h.clientsPolling.Load(uint64(p.ID))
+		if ok {
+			log.Info().
+				Str("func", "notifyChangesToPeers").
+				Str("machine", m.Name).
+				Str("peer", m.Name).
+				Str("address", p.Addresses[0].String()).
+				Msgf("Notifying peer %s (%s)", p.Name, p.Addresses[0])
+			pUp.(chan []byte) <- []byte{}
+		} else {
+			log.Info().
+				Str("func", "notifyChangesToPeers").
+				Str("machine", m.Name).
+				Str("peer", m.Name).
+				Msgf("Peer %s does not appear to be polling", p.Name)
+		}
+	}
+	return nil
+}
diff --git a/namespaces.go b/namespaces.go
index 9b8d190..ff9eeac 100644
--- a/namespaces.go
+++ b/namespaces.go
@@ -169,25 +169,7 @@ func (h *Headscale) checkForNamespacesPendingUpdates() {
 			continue
 		}
 		for _, m := range *machines {
-			peers, _ := h.getPeers(m)
-			for _, p := range *peers {
-				pUp, ok := h.clientsPolling.Load(uint64(p.ID))
-				if ok {
-					log.Info().
-						Str("func", "checkForNamespacesPendingUpdates").
-						Str("machine", m.Name).
-						Str("peer", m.Name).
-						Str("address", p.Addresses[0].String()).
-						Msgf("Notifying peer %s (%s)", p.Name, p.Addresses[0])
-					pUp.(chan []byte) <- []byte{}
-				} else {
-					log.Info().
-						Str("func", "checkForNamespacesPendingUpdates").
-						Str("machine", m.Name).
-						Str("peer", m.Name).
-						Msgf("Peer %s does not appear to be polling", p.Name)
-				}
-			}
+			h.notifyChangesToPeers(&m)
 		}
 	}
 	newV, err := h.getValue("namespaces_pending_updates")