fix the flashing bug in windows