add wrap-tag function and implement in templay functions