TSH_STOP_IF macro, and add mode commands structure