Getting AD group members with custom attributes

I am trying to retrieve a list of users from an AD group using System.DirectoryServices.AccountManagement and then pulling some attributes from the user that isn't available out of the box with a UserPrinciple.

Unfortunately, when I try and use the list of users I retrieved using GetMembers() I run into an issue with casting. I have created a UserPrincipleEx class with all the attributes I require for the program.

System.InvalidCastException: 'Unable to cast object of type 'System.DirectoryServices.AccountManagement.UserPrincipal' to type 'UserPrincipalEx'.

var users = group.GetMembers(true);
foreach (UserPrincipalEx u in users)
{
    User.Create(u.DisplayName, u.SamAccountName, u.certificateOrder, u.certificateID);
}

Is there a way to use the functionality of both GetMember and the UserPrinciple extensions?

Edit 1: Here is the UserPrincipleEx class.

public class UserPrincipalEx : UserPrincipal
{
    public UserPrincipalEx(PrincipalContext context) : base(context)
    { }
    public UserPrincipalEx(PrincipalContext context, string samAccountName, string password, bool enabled)
            : base(context, samAccountName, password, enabled) { }
    UserPrincipalExSearchFilter searchFilter;
    new public UserPrincipalExSearchFilter AdvancedSearchFilter
    {
        get
        {
            if (null == searchFilter)
                 searchFilter = new UserPrincipalExSearchFilter(this);
                return searchFilter;
            }
        }  
        [DirectoryProperty("certificateID")]
        public string certificateID
        {
            get
            {
                if (ExtensionGet("certificateID").Length != 1)
                    return null;
                return (string)ExtensionGet("certificateID")[0];
            }
            set
            {
                ExtensionSet("certificateID", value);
            }
        }
        [DirectoryProperty("certificateOrder")]
        public string certificateOrder
        {
            get
            {
                if (ExtensionGet("certificateOrder").Length != 1)
                    return null;
                return (string)ExtensionGet("certificateOrder")[0];
            }
            set
            {
                ExtensionSet("certificateOrder", value);
            }
        }
        public static new UserPrincipalEx FindByIdentity(PrincipalContext context, string identityValue)
        {
            return (UserPrincipalEx)FindByIdentityWithType(context, typeof(UserPrincipalEx), identityValue);
        }
        public static new UserPrincipalEx FindByIdentity(PrincipalContext context, IdentityType identityType, string identityValue)
        {
            return (UserPrincipalEx)FindByIdentityWithType(context, typeof(UserPrincipalEx), identityType, identityValue);
        }
    }
    public class UserPrincipalExSearchFilter : AdvancedFilters
    {
        public UserPrincipalExSearchFilter(Principal p) : base(p) { }
        public void LogonCount(int value, MatchType mt)
        {
            this.AdvancedFilterSet("LogonCount", value, typeof(int), mt);
        }
    }