modify error message
handle tpl branches in hook