update bugs in template handler