fixes unexpected logout handling