Fix potential race condition - causes invalidation of clients iteration