fix for edge case bug when overwriting public template