Device state on/off improvement