Added delete and template uses right variables