changed logout behaviour