fix hanging on Windows