added awaitTermination