fix a bug for matching type of field, automatically