Flash detection