Fixed contact logic and added to the template.