fixed the template bugs by deleting some code