fix invalidation bug on windows