added support to a customWrap function