adding template to in head insertion mode