moving waitforElement method to a base class