added template remove buttons and corrected template item removal saving