corrected logout behaviour