changed logout handling