sync before shutdown