Revert "changed the wait to a sync task"

This reverts commit ed90955b681a4c407ef929dbd4639b81bca2707f.