using waitForTask instead of deprecated api