correctly handles re-login