fix thread logout handler