fix close on Windows