make use of underlying_cast<int> insted of int cast.