fix bugs in win