Rewrite synchronous block based on fixing -waitUntilFinished