fix race when removing a client