Fix crash on windows