fix race condition for cases sendSub is fast enough for sleepAwhile never to be called, resulting in thread taking 100% of CPU