fix a type cast error on windows