Allow the wait flag to be optional