check dynamic_cast results