Fix bug about template