fixed sso logic