add control flow in smsh