adding the headers dynamic insertion code