fix template not repopulating bug