implement hanging polling for output