fix reconnection bug