bugfix and add winver check