Revert "Revert "Fix windows issue""

This reverts commit 0c9a57c0575bc0ab15b8be02d3f0bc3b9dfb52a2.