add error handling and retry for StaleElementReferenceError