Correctly delete last template