fix a bug in subtype