Add the wait flag back and document why it's necessary to perform the actions in the order they are