Logout logic.