use safe casting in base controller identity