Do some things before sleeping