fix wrapInner implementation