fixed error flash bug