Fix logout hang after 2 hours