created isElementPresent method to check if element is present