sync before sleep