use command sequence logic for finalize update and add shell escaping