refactored Element changes to cast WebElement as Element and return it.