clear retry timer first then emit close event
diff --git a/lib/nodejs/lib/thrift/connection.js b/lib/nodejs/lib/thrift/connection.js
index 5faa24c..b4e5a05 100644
--- a/lib/nodejs/lib/thrift/connection.js
+++ b/lib/nodejs/lib/thrift/connection.js
@@ -202,11 +202,11 @@
 
   // If closed by manual, emit close event and cancel reconnect process
   if(this.forceClose) {
-    self.emit("close");
     if (this.retry_timer) {
       clearTimeout(this.retry_timer);
       this.retry_timer = null;
     }
+    self.emit("close");
     return;
   }