fix infinity loop on windows

Signed-off-by: raidios <raidios.tony@gmail.com>