prevent windows from crashing on startup

this isn't a beautiful solution since it will still throw an exception instead of gracefully failing, but it makes it usable on windows at least