added wrapAsync function to make backwards compatible