Fix logout process