update the usage of waitAllForSafeState