little fix in wait_for_text helper