fix the logout bugs