add total to template