change wrapInner to wrapAll to avoid duplicating code bug