use type name, not id, for the validate function.