changed wait_for_refresh to wait_for_visible_element