fixed some errors in template