Fix flash bug