Remove hook only when we are done running the commands