use wait_for_output util function