Fixed a crash on windows