update the dynamic_cast sample