fixed the flash sequence