ui state bug fixes.