rewriting tag handler