diff --git a/scim-wnn/src/scim_wnn_imengine.cpp b/scim-wnn/src/scim_wnn_imengine.cpp
index f67ee78..50d375a 100644
--- a/scim-wnn/src/scim_wnn_imengine.cpp
+++ b/scim-wnn/src/scim_wnn_imengine.cpp
@@ -176,7 +176,6 @@
     : IMEngineInstanceBase (factory, encoding, id)
 {
     m_iconv.set_encoding ("EUC-JP");
-    m_connected = false;
     preeditors.push_back(new Romkan(_scim_config));
     preeditors.push_back(new KanaInput(_scim_config));
     m_preeditor = preeditors.at(0);
@@ -188,6 +187,7 @@
     for(unsigned int i = 0;i < preeditors.size();i ++) {
         delete(preeditors.at(i));
     }
+    if (wnn.isConnected()) wnn.wnnDisconnect();
 }
 
 
@@ -271,6 +271,10 @@
         _scim_config->read(String(SCIM_CONFIG_WNN_KEY_CONVERSION_IKEIJI),
             String(SCIM_DEFAULT_WNN_KEY_CONVERSION_IKEIJI)));
 
+
+    // �����ǰ�����³���Ƥ�������
+    wnn.wnnConnect(String("scim-wnn"),host,rc,0);
+
 }
 
 
@@ -342,7 +346,7 @@
         hide_aux_string();
     }
 
-        if (yosoku && m_preeditor->getTextLength() && m_connected) {
+        if ((!m_conversion) && yosoku && m_preeditor->getTextLength() && wnn.isConnected()) {
             m_convList = wnn.getYosokuList(m_preeditor->getText());
             if (m_convList.count) {
                 m_lookup_table.clear();
@@ -664,6 +668,8 @@
     m_lookup = false;
     wnn.reset();
     m_preeditor->reset();
+    if (wnn.isConnected()) wnn.wnnDisconnect();
+    wnn.wnnConnect(String("scim-wnn"),host,rc,0);
     updatePreEditor();
 }
 
@@ -708,14 +714,18 @@
  */
 void WnnInstance::startConversion(WideString s)
 {
+    // ����lookup�Ͼä��Ƥ�������
+    m_lookup = false;
+    m_lookup_table.clear();
+    hide_lookup_table();
+
     hide_aux_string();
-    if (!m_connected) {
-        m_connected = wnn.wnnConnect(String("scim-wnn"),host,rc,0);
-    }
-    if (!m_connected) {
-        update_aux_string(utf8_mbstowcs(String(_("could not connect to jserver."))));
-        show_aux_string();
-        return;
+    if (!wnn.isConnected()) {
+        if (!wnn.wnnConnect(String("scim-wnn"),host,rc,0)) {
+            update_aux_string(utf8_mbstowcs(String(_("could not connect to jserver."))));
+            show_aux_string();
+            return;
+        }
     }
 
     wnn.setYomiText(s);
@@ -724,6 +734,7 @@
         show_aux_string();
         return;
     }
+    m_convList.kouho.clear();
     m_convList = wnn.getConversionList();
     m_conversion = true;
 
@@ -733,7 +744,7 @@
     update_preedit_string(wnn.getText(),wnn.getAttributeList());
     update_preedit_caret(wnn.getCaretPos());
     if (alp == -1) {
-        if (!m_lookup) startLookup();
+        startLookup();
     }
     updateProperty();
 }
@@ -744,6 +755,7 @@
  */
 void WnnInstance::createLookupTable(WnnConversionList cList)
 {
+    hide_lookup_table();
     m_lookup_table.clear();
     if (!cList.count) return;
     for (unsigned int i = 0;i < cList.count;i ++) {
diff --git a/scim-wnn/src/scim_wnn_imengine.h b/scim-wnn/src/scim_wnn_imengine.h
index 0d5d65a..5895fa7 100644
--- a/scim-wnn/src/scim_wnn_imengine.h
+++ b/scim-wnn/src/scim_wnn_imengine.h
@@ -99,7 +99,6 @@
     bool yosoku;
     String host;
     String rc;
-    bool m_connected;
     IConvert m_iconv;
     vector<PreEditor *> preeditors;
 protected:
diff --git a/scim-wnn/src/wnnconversion.cpp b/scim-wnn/src/wnnconversion.cpp
index ea2a183..633c5be 100644
--- a/scim-wnn/src/wnnconversion.cpp
+++ b/scim-wnn/src/wnnconversion.cpp
@@ -97,6 +97,22 @@
     return(true);
 }
 
+/*!
+    \fn WnnConversion::wnnDisconnect()
+ */
+void WnnConversion::wnnDisconnect()
+{
+    if (wnn != NULL) {
+        #ifdef HAVE_LIBWNN7
+        jl_yosoku_free(wnn);
+        #endif
+        jl_close(wnn);
+        wnn = NULL;
+    }
+}
+
+
+
 
 /*!
     \fn WnnConversion::isConnected()
@@ -431,3 +447,5 @@
 }
 
 
+
+
diff --git a/scim-wnn/src/wnnconversion.h b/scim-wnn/src/wnnconversion.h
index dbb0515..d8743b4 100644
--- a/scim-wnn/src/wnnconversion.h
+++ b/scim-wnn/src/wnnconversion.h
@@ -74,6 +74,7 @@
     bool resizeRegion(int w);
     void updateFrequency();
     bool wnnConnect(String name,String host,String rc,int timeout);
+    void wnnDisconnect();
     int getCaretPos();
 
 protected:
diff --git a/scim-wnn/src/wnnproto.h b/scim-wnn/src/wnnproto.h
index 4495d56..c6efaa7 100644
--- a/scim-wnn/src/wnnproto.h
+++ b/scim-wnn/src/wnnproto.h
@@ -32,7 +32,7 @@
     #define w_char unsigned short
     struct wnn_buf *jl_open_lang(char *,char *,char *,char *,int (*)(char *),int(*)(char *),int);
     #define jl_open(a,b,c,d,e,f) jl_open_lang(a,b,NULL,c,d,e,f)
-
+    void jl_close(struct wnn_buf*);