Added subtype check