changed to inheritance check