Ah, so. Then maybe an if else assignment of cmd would be less confusing to me.