Fix when flashes is nil