fixed some sleep / awake functions