react to the sleep events