fix error when client is gone