fix static_cast error