changed the wait to a sync task