fix windows build and data integrity issue