@ktf I don't think dynamic_cast is needed here.