bug fix and new template