fix bugs on windows