Fix the bug of logout.