Fixed template bug, now working properly