added a failure test and attempted to deal with StaleElementReferenceError