fixed "last client disconnect" issue