[Ian] refactor to use webdriver wait