workaround for crash on dll unload