fix a few bugs with client-side multiple login issue