make final changes before sleep