added full tag replace code