corrected logout implementation