Add Wait helper function