Change static cast to lexical cast