fix test program
now one can allow user to wait or not wait for the sink to connect to