fix crash on Windows