Fixed UI_STATE_ON / UI_STATE_OFF problem being the wrong way around