Added CheckElementExists method