fixes for windows platform, may break unix