some changes trying to debug dynamic_cast