fix a bug related to inheritance