flush before shutdown began
fix triggers