fixed flashing bug