fixed bugs to build for windows