add wait util functions
Merge branch 'wait-functions'