diff --git a/exec/load/ircd/unregistered.js b/exec/load/ircd/unregistered.js
index 589d04d9feb52d031146546a31cb9102decd8bf8..762b847f93a5dbe751a4f6fda4ec5b50b06fdb7d 100644
--- a/exec/load/ircd/unregistered.js
+++ b/exec/load/ircd/unregistered.js
@@ -315,11 +315,11 @@ function Unregistered_Quit(msg) {
 	else
 		log(LOG_INFO, format('[UNREG] QUIT ("%s")', msg));
 	this.socket.clearOn("read", this.socket.callback_id);
-	this.socket.close();
 	log(LOG_NOTICE,format(
 		"%04u Connection closed.",
 		this.socket.descriptor
 	));
+	this.socket.close();
 	if (   typeof this.cline === 'object'
 		&& YLines[this.ircclass].connfreq > 0
 		&& this.cline.port > 0