Fixed some issue in template