guard free()
improve windows support