fix: use shared_ptr for clients