added missing then statements in shell