Fix logout handler