fix handling of custom field type