add test case for broadcastwait loop and script fix