rename awaitClosure to waitForTermination