added compatibility for windows compiling