fix logout handling