Fix client can't reconnect bug