sleep/awake done only once (when changed)
goto function