add wait_* helper functions