Added locking when accessing clients