extracted is display method from wait until visible method as it was causing some problems