Fix occasional StaleElementReferenceException error