Fix windows crash