changed the code to use wait_until from utils.py