Add a counter to track the number of closed connections