refactored & redirect after logout