Fix stackoverflow in windows