fix casting of ag_login_id