fix the log-in/sign out problem