Fix issue with StaleElementReferenceError