typeid check and messaging