Fix logout functionality