added template and chnged tracking code.