fix logout crash