fix bug introduced in commit 6468b067a9736318a0db0850b200e44db4578e31

the second if applies too if cmd == UI_QUERY_CMD_CHOOSE