both if statements based on cmd var so we should use an if/else if
fixed ui_state_test to conform with recent ui_state changes

this test is still pretty superficial. it would be good to
write a more thorough one at some point